Android - Detect app moving to background and foreground
<p>If application is gone to background and come back after 5 minutes, I need to restart the app.
We can leave the restart part, how will we detect the app moving to background and to foreground? Please help. </p>

<p>If there is a link on details of its official impossibility or possibility, please share.</p>
