Kill Android process after launch
<p>I need to find solution, for killing all foreign applications, except a list of allowed applications (this is task for our corporate managers with Android tablets).</p>

<p>Now, I killing foreign applications in this way (code works by timer in service, each 2 sec):</p>

<pre><code>if (killThisProcess) {
    Log.i("Process to KILL: ", appProcess.processName);

    // kill app
    activityManager.killBackgroundProcesses(appProcess.processName);
}
</code></pre>

<p>This code works, but only when application in background. User can launch application, do something, and only after application will be in background, it will be killed.</p>

<p>How can I kill process, when it in foreground mode, just after launching?</p>

<p>Thanks.</p>
