![](/img/trans.png)
[英]In Android: How can i send the result of from OnPostExecute() to other activity?
[英]How can I kill other foreground activity in android?
我想殺死OTHER(NOT ITSELF)個前台活動/服務。 我檢查了一些有關終止應用程序的方法。
ActivityManager.restartPackage(String packageName)
自android 2.2起不推薦使用。 所以我不能使用這種方法。
ActivityManager.killBackgroundProcesses(String packageName)
我認為這只會殺死后台活動。 但是我想使用startForeground()殺死前台服務。
有什么方法可以殺死其他前台活動/服務?
我回答自己。
我將設備植根並使用NDK來使用shell命令。
然后使用NDK,使用此命令殺死了一些應用程序。
su -c“ am force-stop”
也許您可以使用stopForeground(true) ,然后調用stopSelf()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.