Android Bluetooth - обнаружение отключения от устройства
Я пытаюсь поймать фильтр намерений отключения устройства Bluetooth. Я добавил журнал в onReceive, но он никогда не достигает его и не отображается в logcat. Я подозреваю, что проблема в моей конфигурации manifest.xml:
проявляются:
MyReceiver расширяет BroadcastReceiver:
@Override
public void onReceive(Context context, Intent intent) {
Log.i("got-in", "got-in-");
// String action = intent.getAction();
BluetoothDevice device = intent
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
Log.i("disconnect", device.getName());
Intent i = new Intent(context, BTActivity.class);
Bundle b = new Bundle();
b.putString("deviceName", device.getName());
intent.putExtras(b); // Put your id to your next Intent
context.startActivity(i);
// finish();
}