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).
Now, I killing foreign applications in this way (code works by timer in service, each 2 sec):
if (killThisProcess) {
Log.i("Process to KILL: ", appProcess.processName);
// kill app
activityManager.killBackgroundProcesses(appProcess.processName);
}
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.
How can I kill process, when it in foreground mode, just after launching?
Thanks.
Fortunately, you can’t, except perhaps on a rooted device when running as superuser.
You are welcome to create your own ROM mod that eliminates the apps you do not want and install that ROM mod on the tablets in question.
Or, fire the “corporate managers” who abuse their tablets.
Or, fire the “corporate managers” who do not abuse their tablets, since I can teach a child how to get past your app, and any “corporate manager” stupid enough to not get past your app should not be in a management position.