Skip to content

A simple app that demonstrates executing piece of code using BroadcastReceiver when device boots up

License

Notifications You must be signed in to change notification settings

raheemadamboev/boot-completed-receiver

Repository files navigation

boot-completed-receiver

Executing a code whenever the device boots up can be crucial in several scenarios. One use can be rescheduling alarms since they are canceled after the device boots up.

Download demo


Receiving ACTION_LOCKED_BOOT_COMPLETED when the device is booted but it hasn't been unlocked by the user yet. We unlocked the device to see the toast message.


Receiving ACTION_BOOT_COMPLETED when the device is booted and it has been unlocked by the user.

If you register the BroadcastReceiver for both ACTION_LOCKED_BOOT_COMPLETED and ACTION_BOOT_COMPLETED at the same time, you will receive actions 2 times. Be careful if you have to execute your code only once.


Xiaomi devices require AutoStart manufacturer-specific permission to be able to receive ACTION_LOCKED_BOOT_COMPLETED or ACTION_BOOT_COMPLETED actions.

About

A simple app that demonstrates executing piece of code using BroadcastReceiver when device boots up

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages