A prioridade mais alta do receptor de transmissão não está funcionando
Estou fazendo um aplicativo usando o manipulador ACTION_MEDIA_BUTTON, mas parece que ele é sempre interceptado pelo MX Player ou pelo Apollo e não recebo nenhuma intenção
Eu tentei conjunto de prioridade de 1000 e 2147483647 na marca e diretamente após o construtor com setPriority
Aplicativos funciona quando não há Player MX ou Apollo presentes
Eu também tentei usar o aplicativo Headset Interceptor do Google Play, eu tentei negar eventos para o MX Player com o aplicativo Autostarts - nada ajuda
em onCreate:
IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON);
filter.addAction(Intent.ACTION_HEADSET_PLUG);
filter.setPriority(1000);
registerReceiver(receiver, filter);
no receptor
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) {
// NEVER REACHES HERE WHEN MX PLAYER PRESENT. WORKS IF NOT
no manifesto
<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>