Onreceive () does not work with Android O

I am testing an Android phone. I have a Broadcast receiver registered to receive a Bluetooth status change event. I added this to my code as

context.registerReceiver(receiver , BluetoothAdapter.ACTION_STATE_CHANGED)

When I test, the callback does not come to onreceive(). I read that Android O does not support implicit broadcasting. I’m not sure why I’m onreceive()not fired. Is a Bluetooth action state change fixed that has problems with Android O?

+4
source share
1 answer

ACTION_STATE_CHANGED is not on the Implicit Translation Exclusions list .

ACTION_CONNECTION_STATE_CHANGED, ACTION_CONNECTION_STATE_CHANGED, ACTION_ACL_CONNECTED / ACTION_ACL_DISCONNECTED, , .

0

Source: https://habr.com/ru/post/1683661/


All Articles