If I put counter at OnCreate(), then it will count how many times activity was created, when I need to identify 20th run of the application.
If I put counter at OnCreate() , then it will count how many times
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can implement your own Application class.
MyApplication extends Applicationand set it as your Application in the manifest.In MyApplication you implement
onCreateandonTerminate.I took this from here.
Once you have implemented your own create and terminate, in those methods you can increase the count and store it in
sharedpreferences.