[英]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.