Killing the Background running Activities such as Messaging, Browser, Contact etc in Android
<p>I am trying to Kill the Background running Activities such as Messaging,  Browser,  Contact etc in Android.  I have written the following code.</p>

<pre><code>amm=(ActivityManager) getSystemService(ACTIVITY_SERVICE);   
List&lt;RunningTaskInfo&gt;task1=amm.getRunningTasks(20);
for (ActivityManager.RunningTaskInfo aTask1 : task1) {
packagename=aTask1.topActivity.getPackageName();
Log.d("raghutest", ""+packagename);
myarraylist.add(packagename);
  }
if(myarraylist.get(position) != null)
{
am.killBackgroundProcesses(myarraylist.get(position));
Log.d("result", "task successfully killed"+myarraylist.get(position));
}
}
</code></pre>

<p>But I am getting warning something like this   </p>

<blockquote>
  <p>WARN/InputManagerService(68): Window already focused, ignoring focus
  gain of:
  com.android.internal.view.IInputMethodClient$Stub$Proxy@44f2ebf8</p>
</blockquote>
