How do I prevent the user from closing my app?
android, exit, locking
Solution
Android only provide back button override function. It will not allow user to disable home key and recently open key.
But we can replace the home screen to our application in this way first we select our application as a launcher. So, if user press home key the home screen replace to our application and it will only open our application. For this effect add these lines in Manifest file:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Problem
I've an android application that will be used in a restaurant, so I want that users can't exit from the app. The only thing that users can, is using application. (If possible only admin can exit from app, by logging in or restarting device, I don't know which is the best way). Is there a solution or other way to do this?