Issue
I want to log when the user opens and kills the app, and when it is put to the background. So far I have been trying with onStart/onStop/onPause/onResume/onDestroy etc, but this is only about the activity that I put this on, not the entire app. So when the user goes from the MainActivity to some other Activity inside the app, I don't need to know, but when he then goes out of the app, or even kills it, I would like to log that.
Any suggestions? (Did I write it down clear enough?)
Solution
onCreate()?
See the lifecycle diagram
Given your comments it seems you want the Application Lifecycle
Make a class that extends Application to make use of these (it will be instantiated automatically), just make sure you specify its name in your AndroidManifest.xml's application tag
Edit
I see your confusion, you want just oncreate/terminate here on the Application class
Answered By - Nick Cardoso
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.