Broadcastreceiver Doesnt Receive When App Is Closed
Solution 1:
As I found there is no way to active BroadcastReceiver in Huawei Devices programmatically, but here is a solution to find device type and do needed action in this regard such as show an alert to user to activate it manually.
if ("huawei".equalsIgnoreCase(android.os.Build.MANUFACTURER)) {
// Do Needed Action
}
Solution 2:
I faced with same problem on Huawey Honor with Android 7. On Sony and ZTE devices BroadcastReceiver works as expected. But on Honor it work some time and suddenly stop. I discover, that problem not related with re-boot. I reboot device and broadcast receiver work after it. But sometimes, it stop without rebooting.
First i add my app to protected list according this solution: "Protected Apps" setting on Huawei phones, and how to handle it
But it didn't help :(
Then, i add a fake accessibility service to my app, according to this recommendation: Broadcast Receiver Not Working After Device Reboot in Android
And problem was solved!
Post a Comment for "Broadcastreceiver Doesnt Receive When App Is Closed"