I am building an app that will form part of an exhibition. It will be displayed on a Nexus 7 which will be securely mounted. The app has touchscreen functionality and will d
Further to the above, which all worked great, and to make sure a comprehensive answer is out there.....
AFAIK, there is no way of overriding the recent apps button.
I got around this by change onPause app behavior to start an alarmmanager. There may be a more elegant solution, but this works.
First, create repeating alarmmanager setupAlarm(seconds)( full details here and here, note I used repeating alarm rather than one off, think both will work though) that starts your activity
then change onPause to set a 2 second alarm, so whenever someone selects the recent apps button on the nav bar, a 2 second 'alarm' to start mainActivity is set.
@Override
public void onPause() {
setupAlarm(2);
finish(); //optional
super.onPause();
}
So with this and the above, any attempt to use the navigation buttons or restart the app results in app starting. So until I get round to investigating the 'kiosk' style roms this is a very good compromise.