Hello,
I'm working on a video player, works very well. the only detail, i want detect the external buttons, for example via bluetooth, as does native. this codse does not work in my app. help my please!!
SDK: 3.2.3 GA platform android 4.2.2 Device: XPERIA M
manifest:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <receiver android:name=".RemoteControlReceiver"> <intent-filter> <action android:name="android.intent.action.MEDIA_BUTTON" /> </intent-filter> </receiver> </application> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> </manifest> </android>code:
var RemoteControlReceiver = Ti.Android.createBroadcastReceiver({ onReceived: function(e) { alert("hello, ACTION_MEDIA_BUTTON"); } }); Ti.Android.registerBroadcastReceiver(RemoteControlReceiver, [Ti.Android.ACTION_MEDIA_BUTTON]);