I'm creating an app where, if the user presses a certain combination of buttons, then the app currently running on the screen is killed. For example, if the user is running the Google App and then enters the combo of hardware buttons, the app will be killed. How do I get the app that's currently on screen and kill it?
Asked
Active
Viewed 93 times
1
-
1Maybe this helps. http://stackoverflow.com/questions/14198479/kill-service-by-package-name – OneCricketeer Jul 13 '16 at 03:49
-
Thanks @cricket_007. It really helped. It allows me to kill the app by PID but I want to be able to get the PID of the app currently on screen and then kill it. – Anish Muthali Jul 13 '16 at 04:06
-
I'm not sure of anyway to programatically determine the currently open process – OneCricketeer Jul 13 '16 at 04:07