I have a rooted Android device. At one point I launch a secondary application from my primary application like so:
Intent intent = getPackageManager().getLaunchI
Found a solution:
Process suProcess = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(suProcess.getOutputStream()); os.writeBytes("adb shell" + "\n"); os.flush(); os.writeBytes("am force-stop com.xxxxxx" + "\n"); os.flush();