简体   繁体   中英

OnPause state Force to Kill the Android App

I am new to Android development.I have created a small app and i have start the app in my device it's working good.After some state i hit the "home" button so the Activity should go to the onPause() state then i used some other application.My issue is It keeps the activity in the background nearly 45 minutes after it force to move onStop() method and close the Android App.When i again go to the home and click the icon instead of calling restart() method it's calling onCreate() method.

Thanks in advance.....

in onPause() you can call Activity_name.this.finish()

You may want to learn a little more about Activity life cycle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM