Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何杀死其他应用程序?_Android_Kill Process - Fatal编程技术网

Android 如何杀死其他应用程序?

Android 如何杀死其他应用程序?,android,kill-process,Android,Kill Process,如何杀死其他应用程序?我可以使用intent启动其他应用程序,但找不到杀死它们的方法 这将启动应用程序: Intent i = new Intent(); i.setAction(Intent.ACTION_MAIN); i.addCategory(Intent.CATEGORY_LAUNCHER); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setComponent( new ComponentNa

如何杀死其他应用程序?我可以使用intent启动其他应用程序,但找不到杀死它们的方法

这将启动应用程序:

Intent i = new Intent();
    i.setAction(Intent.ACTION_MAIN);
    i.addCategory(Intent.CATEGORY_LAUNCHER);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    i.setComponent(
        new ComponentName("com.bla.bla...", 
            "com.bla.bla.Main"));
    context.startActivity(i);
我试着用活动经理的杀手锏

killBackgroundProcesses(String packageName)
但那没用

我也试过了

 appContext.stopService(intent)
但那没用