I know, too many questions already raised on this topic but, that are not supported in all OS / devices
android.permission.GET_TASKS
is depricated.You can have 2 approaches to this that may be acceptable, otherwise you are probably out of luck.
1) Make your app the "launcher" app. Users will then be interacting with your app in order to launch apps in general. Notification based launches and other types of interactions you may not be able to track, but I have not tried.
2) Make your app "pretend" to be a launcher app. After it launches, it displays a launcher type screen. You then have to handle attempts to press "home" by checking if your app is in the background and bringing it into foreground if it is. This is not an easy task - it's likely you will have bugs, etc. but it seems possible (I only know that determining if your app is "in the background" can be tricky because dialog boxes and notifications can take the foreground, but you do not want to dismiss those (most of the time I assume).
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With