Reputation: 57
I am using alarm in my application.I need to know how to save its state once the application has been closed.what I want that when I restart my application the previous set alarm should exist.please help.thanks in advance.
Upvotes: 0
Views: 657
Reputation: 5239
The alarm will exist even when the Activity is closed. However, it won't exist after boot, so you might want to store the desired alarm time in a SharedPreference value, then listen for BOOT_COMPLETED and set your alarm again.
Upvotes: 1