I am developing an app which needs to listen to the android.intent.action.ACTION_BATTERY_CHANGED intent in the background.

I understand that since API 26, it is no longer possible to "statically" register implicit BroadcastRecievers in the manifest. Whilst I can register in Context, I need the BroadcastReceiver to continue receiving in the background, when the Activity has stopped.

What is the best way to approach this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.