I am using an application using the ACTION_MEDIA_BUTTON handler, but it seems like it is always intercepted by MX Player or Apollo, and I don't get Intent
I tried both 1000 and 2147483647 priority set in the tag, and right after the constructor using setPriority
Applications work if there is no MX Player or Apollo
I also tried using the headset interceptor application from Google Play, I tried to block events in MX Player using the Autostarts application - nothing helps
in onCreate:
IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); filter.addAction(Intent.ACTION_HEADSET_PLUG); filter.setPriority(1000); registerReceiver(receiver, filter);
in the receiver
@Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) {
in manifest
<receiver android:name="BCreceiver" android:enabled="true"> <intent-filter android:priority="1000"> <action android:name="android.intent.action.MEDIA_BUTTON" /> <action android:name="android.intent.action.HEADSET_PLUG" /> </intent-filter> </receiver>
source share