Not able to kill another android application
<p>I am trying to kill another android process(app) from another application. But i am not able to do so..</p>

<pre><code>private boolean isReaderAppRunning() {
    ActivityManager activityManager = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
    List&lt;RunningAppProcessInfo&gt; procInfos = activityManager.getRunningAppProcesses();
    boolean isFound = false;
    for(int i = 0; i &lt; procInfos.size(); i++){
        Log.e("SSSSSSS NAMEEEEE", procInfos.get(i).processName);
        if(procInfos.get(i).processName.equals("com.bosch.bst_acp")) {
            int pid = android.os.Process.getUidForName("com.bosch.bst_acp");
            android.os.Process.killProcess(pid);
            activityManager.killBackgroundProcesses("com.bosch.bst_acp");
            isFound = true;
        }
    }
    return isFound;

}
</code></pre>

<p>I am getting the pid as -1 even after adding the permissions. Can anyone tell me what i have done wrong ?</p>

<pre><code>&lt;uses-permission android:name="android.permission.GET_TASKS"&gt;&lt;/uses-permission&gt;
</code></pre>

<p> </p>
