Kill another application in android?
<p>I am try to kill my another application. But this code is not able to kill my another application. I know kill another application is a bad idea. But I have learning purpose, I have tried to kill. My code part<br/></p>

<pre><code>Button runningApp = (Button) findViewById(R.id.runningApp);
runningApp.setOnClickListener(new View.OnClickListener()
{
    @Override
    public void onClick(View v) 
    {
        String nameOfProcess = "com.example.filepath";
        ActivityManager  manager = (ActivityManager)ApplicationActivity.this.getSystemService(Context.ACTIVITY_SERVICE);
        List&lt;ActivityManager.RunningAppProcessInfo&gt; listOfProcesses = manager.getRunningAppProcesses();
        for (ActivityManager.RunningAppProcessInfo process : listOfProcesses)
        {
            if (process.processName.contains(nameOfProcess))
            {
                Log.e("Proccess" , process.processName + " : " + process.pid);
                android.os.Process.killProcess(process.pid);
                android.os.Process.sendSignal(process.pid, android.os.Process.SIGNAL_KILL);
                manager.killBackgroundProcesses(process.processName);
                break;
            }
        }
    }
});
</code></pre>

<p>I have added Permissions are</p>

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

<p>Every time I can see the Log cat, the particular application is running in the background. Where i am mistaken. Guide me. Thanks.</p>
