Is there a good way to check if an entire application (not an activity!) is closed by the user? I want to log the time a user spends using the application, so a simple activity onPause() ,onStop() or onDestroy() is not sufficient.
There are several ways an application can be closed, either the user pressing the home button, search button or simply leaving the application. Is there a unified (eg. simple) way to see if any of these things happened?
Neither of these actually closes the application. The activities will continue to run unless you explicitly call
finish()or the system kills them when it runs out of resources.Why is not sufficient to use
onResume()andonPause()?