love_bird
love_bird

Reputation: 57

how to schedule activity by using alarm manager in android?

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

Answers (1)

Iiro Krankka
Iiro Krankka

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

Related Questions