Nathan Fig
Nathan Fig

Reputation: 15119

Is ACTION_BOOT_COMPLETED a sticky broadcast?

The docs do not say one way or the other, but I can't imagine why you wouldn't let that stick.

My application goes into a paused mode when the SD card is not present- however if the user launches my application before the system is done booting, it goes into pause mode. So I'd like it to detect if the system has yet to finish booting and wait a few seconds accordingly.

But it becomes a moot point if your application has to already be running to hear ACTION_BOOT_COMPLETED broadcasts.

Upvotes: 2

Views: 2256

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007554

I can't imagine why you wouldn't let that stick.

That being said, according to the source code, it is not sticky.

however if the user launches my application before the system is done booting, it goes into pause mode

How is that possible?

But it becomes a moot point if your application has to already be running to hear ACTION_BOOT_COMPLETED broadcasts.

No, it does not. In fact, the only way to get ACTION_BOOT_COMPLETED broadcasts is via a manifest-registered BroadcastReceiver, specifically because you cannot assume that any of your code will be executing at the time of the broadcast.

Upvotes: 5

Related Questions