title: Detect user change clock time after Force Stop app
body: <p>I can detect change clock time when app in foreground, background, or kill from <code>Recent App</code> by using <code>android.intent.action.TIME_SET</code> follow <a href="https://stackoverflow.com/questions/15544996/is-there-a-way-to-detect-when-the-user-has-changed-the-clock-time-on-their-devic">here</a>.<br>
  However, if I <code>Force Stop</code> app in <strong>Setting->Apps</strong> I can not receive this broadcast anymore.<br>
  Currently, I want to detect user change clock time come back to my app after ForceStop so I do </p>
  
  <pre><code>long deltaTimeBeetweenCurrentTimeAndTimeSinceReboot = System.currentTimeMillis() - SystemClock.elapsedRealtime();
  long oldDelta = mSharedPreference.getDeltaTimeBeetweenCurrentTimeAndTimeSinceReboot();
  if(deltaTimeBeetweenCurrentTimeAndRebootTime - oldDelta &gt; 5000){
      // clock time change
  }
  </code></pre>
  
  <p>Idea is I saved a delta between currently time (<code>System.currentTimeMillis()</code>) and time since reboot (<code>SystemClock.elapsedRealtime()</code>). Every time I open app, I will compare oldDelta and newDelta (except the first time install). It work well in case: User <code>Fore Stop</code> app->Change time->come back to app.</p>
  
  <p>However, there is still have 1 case that is: User <code>Fore Stop</code> app -> Change the clock time -> Reboot device -> Open my app. At this time I can not use the above method to check the clock time have changed because after reboot the <a href="https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()" rel="nofollow noreferrer">SystemClock.elapsedRealtime()</a> will reset. How can I detect clock time have changed in that case?<br>
  Any help or suggestion would be great appreciate.</p>