title: How to kill all running applications in android?
body: <p>I want to kill all running applications in android. so for this task, I've implemented the following code. But it is not working. The app still remains running.</p>
  <pre><code>ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
      for (RunningAppProcessInfo service : manager.getRunningAppProcesses()) {
      Log.i(&quot;process name &quot; , service.processName);
      
      android.os.Process.killProcess(service.pid);
      }
  </code></pre>
  <p>So where did I make a mistake in the code?</p>