Nixit Patel
Nixit Patel

Reputation: 4445

can AlarmManager(alarm.setRepeating) work in case of phone restart - Android

I came in to scenario that I want to trigger service on specific time.

What I Know is... I need use AlarmManager, and I found this question in hear, Using Alarmmanager to start a service at specific time. Now, I am able to start service on specific time.

Now question I have is... I need 24H interval to start service. now What happens if the phone restart. Is it going to start service again?

How can I make this thing happen? Please help me with this

Thank you

Upvotes: 5

Views: 1023

Answers (2)

user2460829
user2460829

Reputation: 11

You'll need to register a BroadcastReceiver that can receive the BOOT_COMPLETED message so it receives a message when the phone reboots...

Read this article!

http://karanbalkar.com/2013/07/tutorial-41-using-alarmmanager-and-broadcastreceiver-in-android/

Upvotes: 1

ngesh
ngesh

Reputation: 13501

No.. It wont.. You need to set it again when phone Boots .. something like this

Upvotes: 5

Related Questions