How to prevent user from closing application - Android 4.0.3

Mihael Meklav picture Mihael Meklav · Aug 1, 2012 · Viewed 7.2k times · Source

So my question is: If is possible to prevent user from closing application.

Problem is because i can't hide action bar and i use tablet only for work time registration. So if someone press home button or back button is that not acceptable.

So i wonder if i could somehow handle onclose event?

Is it possible to open application in fullscreen (with no action bar)?

Answer

Tomislav Novoselec picture Tomislav Novoselec · Aug 1, 2012

You cannot prevent user from closing application if he presses home button. That's the whole idea of it. Otherwise, you could leave user trapped in your app with no means to exit but to reboot it's device.