Android equivalent to applicationDidBecomeActive and applicationWillResignActive(from iOS)
<p>I hope it exists.</p>

<p>I would like to store the time when the application loses focus and then check if it has lost focus for more than n-minutes to bring up a lock.</p>

<p>Seeing how an application is composed of activities, I think there will not be a direct equivalent.  How would I be able to achieve similar results?</p>

<p>EDIT<br>
I tried to extend the Application class to <code>registerActivityLifecycleCallbacks()</code> and realized I will not be able to use this approach because it is only available in API Level 14+</p>
