Skip to main content
Inspiring
March 3, 2015
Question

AIR Android app - prevent app from being exited

  • March 3, 2015
  • 1 reply
  • 567 views

I am developing a simple Air app for an android tablet (Kitkat) that will be used in a visitor centre in a 'kiosk' mode. I would like to completely prevent users from exiting the app by using the back, home or menu buttons. While I know that the back and menu buttons can be intercepted in Air, the Home button cannot. Does anyone know of a way (perhaps another app / background service, native extension), that will prevent my app from being exited? I've looked at the screen pinning option on Android Lollipop, but I don't think it's a viable and elegant solution.

This topic has been closed for replies.

1 reply

March 4, 2015

I think the best you can do is make it difficult to exit the app. If the tablet being used as a kiosk has (or could have) the edges of the screen somewhat covered so that you cannot swipe inward from the outer edge, you could create an ANE that would put the app in Full-screen Immersive mode. This is a new feature of KitKat that hides the on-screen buttons as well as the clock bar for a true fullscreen app. The only way to bring the on-screen buttons and clock bar back is to swipe inward from an edge of the device. So if the kiosk station could be setup so that those swipe actions could not be done, you should be safe and have an app that cannot be closed.

https://developer.android.com/about/versions/kitkat.html#44-immersive

https://developer.android.com/about/versions/android-4.4.html#UI

https://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)