How to Force close all Applications Running in the Backgroung of the phone Programatically?
<p>I want to force close all applications running in the background of the phone after Every 2 seconds.How to do that?I found a lot here on SO as well as on Google Still not got the right Solution yet.So Please someone help me for my this issue.</p>

<pre><code>activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    List&lt;ActivityManager.RunningTaskInfo&gt; Runningtasks = activityManager
            .getRunningTasks(Integer.MAX_VALUE);
    for (int i = 0; i &lt; Runningtasks.size(); i++) {
        ComponentName comName = Runningtasks.get(i).topActivity;
        Packname = comName.getPackageName();
        String Classname = comName.getClassName();
        marray_adapter.add(Packname);
        lst_list.setAdapter(marray_adapter);

    }
activityManager.killBackgroundProcesses(Packname);
</code></pre>
