Q:

detect if device rebooted between two application use or not

In nutshell, I need to detect if device rebooted between two application use or not.
Here is why I need that: I create an app and I need to know the reliable date and time and save tasks with that date and time into device database and after while, sync that data. Also it is important that users can use this app while offline. I tried many things, even try to use NITZ but no one works for me. 
So I end up with this scenario: 

When user want to save a task, I get the server time and save it with device boot time ( From elapsedRealTime() )
After that when user want to save a task, I can find the reliable time with compare two boot time value and add the difference to saved server time
If user reboot the device, I need to repeat step 1

I mean in each boot, I need to get server time once. For this I need to know if device rebooted or not and I have no idea how to do that.

A:

See this question, on how you can create a receiver to catch the BOOT_COMPLETED event.

