I have two different apps, this hypothesis two apps are A and B. there are many service at A app,my task is want to kill the service of A using method of B, but A and B are not apk ,are different apps.
i used :
ActivityManager manager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
List<RunningAppProcessInfo> activityes = ((ActivityManager) manager).getRunningAppProcesses();
for (int i = 0; i < activityes.size(); i++){
Log.e("APP: "+i, activityes.get(0).processName);
if (!activityes.get(i).processName.contains("com.qihoo360")){
//android.os.Process.killProcess(activityes.get(1).pid);
Log.i("dfd","xx");
manager.killBackgroundProcesses("com.qihoo360.mobilesafe");
android.os.Process.sendSignal(activityes.get(1).pid, android.os.Process.SIGNAL_KILL);
}
}
but no useful.but at mobile setting manager App ,it have a close button to close it. if i no authority to kill another app because System security.