简体   繁体   English

如何在Android中杀死第三方进程

[英]How to kill 3rd party process in android

My application will launch 3rd party map activity and set the place. 我的应用程序将启动3rd party地图活动并设置地点。 Once user press back from Map activity, it will return to previous activity. 用户从“地图”活动中按回后,它将返回到上一个活动。

Once i quit the application, the map activity and other process will be keep running. 一旦我退出应用程序,地图活动和其他过程将继续运行。 i would like to close them. 我想关闭它们。 How should i do? 我应该怎么做?

Thanks in advance 提前致谢

Try Launching the foreign activity with FLAG_ACTIVITY_NO_HISTORY 尝试使用FLAG_ACTIVITY_NO_HISTORY启动外部活动

A process is not the same as an Activity, and it's not your concern if a process (even your own) remains alive when not in use, as Android will dispose of it when appropriate. 一个进程与一个Activity是不同的,如果一个进程(甚至是您自己的)在不使用时仍处于活动状态,则不必担心,因为Android会在适当的时候对其进行处理。

You should never try to kill foreign processes (you can't anymore anyway), and the situations where you want to kill or end your own are rare (mostly for testing to make sure you can recover). 您永远不要尝试杀死外部进程(无论如何也不能这样做),并且您想要杀死或结束自己的情况的情况很少见(主要是进行测试以确保您可以恢复)。

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

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