1

I have a boot receiver working perfectly in my app.

Now, I need to know if my receiver is enabled on the system, because some UI systems like MIUI (EMUI, etc.) let change this kind of permissions to the user...

Enable start applications from boot

I have been reading about that on this post How to check if Receiver is registered in Android? But best answers came from 2010! (pre Gingerbread).

The most common response is: there is no way, you can just call unregisterReceiver and swallow the exception...

But sincerely.. I don't understand the logic behind that or how I can take advantage of this workaround.

  • Is there a new way to check broadcast receivers?
  • If not, How can I use unregisterReceiver safely? (I don't really want to unregister my receiver)

Any advice and suggestions will be greatly appreciated.

Community
  • 1
  • 1
David Isla
  • 619
  • 7
  • 19
  • Is this a receiver registered in the Manifest or registered in the Activity? – DeeV Nov 21 '16 at 22:07
  • Registered in the Manifest, why? – David Isla Nov 21 '16 at 22:08
  • Because you don't have a reference to the receiver from the Manifest (The system creates it) so you couldn't use `unregisterReceiver` anyway. – DeeV Nov 21 '16 at 22:12
  • I'm worried that none of those things would work anyway because this is a custom feature of MIUI. Their way of doing it may be to keep your `BroadcastReceiver` registered, but simply not send the broadcast to it when the time comes. – DeeV Nov 21 '16 at 22:13
  • In this case, there isn't any solution.. thx @DeeV – David Isla Nov 21 '16 at 22:23

0 Answers0