I\'m trying to detect if an Android device has rebooted since the last time a preference value is set. Ideally, I\'d like to do it without the android.permission.RECEIVE_B
Yes you can do that using Application class and the Non-Static broadcast Receiver ACTION_SHUTDOWN. The Application class got started in two cases
When ACTION_SHUTDOWN received use your application Shared-preferences or database to save a boolean shutdown = true when application class starts check this boolean. If it is true then the device is booting , else the user forced your app to stop.
To get more info you can read the following post that I wrote and try the code example in which, I added