I am looking into how to keep my Android app running in the foreground.
It will be a privately distributed app, so I can do anything possible to make sure it runs consta
You could make your app become a launcher, by adding 2 following category tags into tags:
then you should always check if there's another app run on top, run following code to direct user to our app:
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
I have tried this solution, but it cannot hide apps that draw on top, like Facebook Messenger chat head.