I am developing a simple stopwatch the problem is when the user presses the home button the thread witch calculates the time freezes how can i avoid that make the thread run in background ?
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.
A much simpler solution would be to record the start time of the stopWatch using system.currentTimeMillis.
when your activity onResume or onStart() is called, update the watch to show the time that elapsed from the time you’ve saved.