How can I recognize those events from whitin an Android app?
As far I know the closest solution is the one presented here: https://stackoverflow.com/a/15573121/558433
But also, this doesn't recognize appClose ( and is a time-based workaround =/ ).
I tought that the main activity onDestroy may be the "exit point", but that method is called trough Activity lifecycle several times (between Activity transactions and so on).
So that's the question, how can I recognize the events: Application moved to Background (such home button pressed); Application moved to Foreground (Activity restored from stack while in background); Application fully closed (probably a final destroy of the first activity); Application closed while in background (such from user action or by Android system);
Thanks in advance!