How to stop application from running in background in android?
I want my application to start fresh everytime it loads. How to do it programatically.
How to stop application from running in background in android? I want my application
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.
Override
onStopmethod of your activity:But I think it’s a bad idea to restart your app each time. It’s better to override
onStartmethod, and handle “restart” here.Actually, your app doesn’t “run” in background. Android OS keeps it in memory, or saves state of your activity to device (and then you can load it, using
savedInstanceStateparam inonCreatemethod).