简体   繁体   中英

My Android APP's process has been killed, but still in RunningTask

I have got some programs, need help. I switch my app(have activity) to background(eg:By Home-Key), and use other APP to kill it. then check it by Using getRunningTasks() and getRunningAppProcesses(), but i can not understand the result : I can find the app's Activity(TopActivty/BaseActivity)in the RunningTasks, but not in RunningAppProcesses My problems: 1、Home can i remove all Activity when the process been killed? 2、In this case, how can i restart my APP when click the app-icon?

Thanks

can i remove all Activity when the process been killed?

When your process goes away, your activities, services, threads, and all that go away as well.

However, the "task" remains. This is basically a description of the back stack for your app, and any apps launched from it that were launched into your task versus starting a fresh back stack in another task. This description includes things like your saved instance state (ie, onSaveInstanceState() Bundle ), the Intent that was used to start the activity, etc.

how can i restart my APP when click the app-icon?

If the user is returning to your app via the recent-tasks list, ideally you do not "restart" the app, but return the user to where the user left off.

The developer documentation covers various ways that you can control, somewhat, the behavior of the back stack and your app (or individual activities) as they come back into being when the user returns to one of your tasks.

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