I have an Alarm Manager which send Intent to BroadcastReceiver. This Broadcast is not in Manifest. I register it onResume and unregister onPause in my Activity. What I need is to Save 2 boolean Preferences when app is not active and time of alarm is come. How to do that ?
I have an Alarm Manager which send Intent to BroadcastReceiver. This Broadcast is not
Share
You can’t do it if you register in the activity.
You need to move to manifest and have a dedicated broadcast receiver class for it. This way even if the activity is not running you will still get the alarm.
In the BroadcastReceiver than you can write to Preferences.