Android: Can I detect the user has left the app?
<p>I am developing an android app and want to detect when the user exit the app either by clicking back button or home button. </p>

<p>Or also if there is an event like onInit is also useful for my scenario, 
as I just want to alway MyInıt action starts at first.</p>

<p>onDestroy is not called till other apps need more memory.</p>

<p>Thanks.</p>
