Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent user from closing application - Android 4.0.3

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)?

like image 518
Mihael Meklav Avatar asked Aug 01 '12 11:08

Mihael Meklav


2 Answers

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.

like image 87
Tomislav Novoselec Avatar answered Sep 20 '22 20:09

Tomislav Novoselec


Short answer is no.

Long answer is that you can make it quite difficult for the user to close you app. Some of the tricks that can be used are: reopen you app as soon as it closes , disable keys like back and power and finally disable the home button

like image 29
PC. Avatar answered Sep 22 '22 20:09

PC.