title: killBackgroundProcesses no working
body: <p>First, I found some similar questions on StackOverflow but none of the answers there solves my problem. I also googled it and read all the top 30 results.</p>
  
  <p>So I am writing a Service that will check what is running in foreground every, say, 20 seconds. If the foreground application is on a blacklist, then I will popup a dialog Activity to say that "the current application needs to be stopped", then when user press OK of that dialog, that application will be stopped via the following method:</p>
  
  <pre><code>private void killApp(String packageName) {
      ActivityManager am = (ActivityManager)getApplicationContext().getSystemService(ACTIVITY_SERVICE);
      Log.d(TAG, "Trying to kill app " + packageName);
      am.killBackgroundProcesses(packageName);
  }
  </code></pre>
  
  <p>However, the application is not stopped at all in my test. When the dialog is closed, the foreground app is still there, exactly the same state as it was before the dialog popped up. I believe I have the right API level as well as necessary permissions:</p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="11"
      android:targetSdkVersion="18" /&gt;
  
  &lt;uses-permission android:name="android.permission.GET_TASKS" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  &lt;uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /&gt;
  </code></pre>
  
  <p>I am really stuck, any help will be greatly appreciated!</p>