简体   繁体   English

我的Android APP进程已被终止,但仍在RunningTask中

[英]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. 我将我的应用程序(具有活动)切换到后台(例如:按Home键),并使用其他APP杀死它。 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? 然后使用getRunningTasks()和getRunningAppProcesses()进行检查,但我不明白结果:我可以在RunningTasks中找到应用程序的Activity(TopActivty / BaseActivity),但在RunningAppProcesses中找不到我的问题:1,我可以删除所有主页活动何时被杀死? 2、In this case, how can i restart my APP when click the app-icon? 2,在这种情况下,单击应用程序图标后如何重新启动我的应用程序?

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. 此描述包括您保存的实例状态(即onSaveInstanceState() Bundle ),用于启动活动的Intent等内容。

how can i restart my APP when click the app-icon? 单击应用程序图标时如何重新启动我的APP?

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. 开发人员文档涵盖了一些您可以控制的方式,其中包括当用户返回您的一项任务时,后堆栈和应用程序(或单个活动)重新出现时的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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