How to programmatically kill a chat head, for example an app, another app?

I am writing an application that controls access to other applications. The user can decide which application he wants to block on the device. If someone launches a blocked application, they see a screen informing them of the blockage. I have my own startup and background process that checks to see if an open activity is currently blocked. To check the top activity, I use the package and class name from ActivityManager getRunningTasks (); If this application is locked, I close it with my own view by adding it to WindowManager. This works for every app except that it also uses WindowManager like facebook chat puzzles or multitasking introduced by LG - QSLIDE. This app is not from the top. Of course, I can find her process using getRunningAppProcesses.but I cannot kill him. Android.os.Process.killprocess doesn't work either. I know this is not a good idea, but I have no other.

Is there a way to find out that some application added something to WindowManager and eventually block it? Or just delete the view or kill the app?

+3


source to share


1 answer


Facebook (and many other apps) refer to the SYSTEM_ALERT window to control their little chat heads. As of writing this (6.0.1), there is no API to listen to added views and / or collect any information about that view.



0


source







All Articles