Answer the question
In order to leave comments, you need to log in
How to disable the back button in the application?
I added a pin code entry window to the application, but when the back button is pressed, the pin code entry window closes and the user enters the application without entering the pin code.
How can I disable the back button in the application?
Answer the question
In order to leave comments, you need to log in
Make an override to call onBackPressed and/or KeyEvent.KEYCODE_BACK with an empty\action you need.
Although it looks like a crutch, and the situation you describe should be solved in other ways.
I would not disable the back button. Do you already have a successor from AndroidApplication ?
Needed as a common storage for all activities.
It has a static method PinEntered()
In the remaining activities, when they come to the fore, MyApp.PinEntered() would check
and if not, then enter it.
You can write your own activity class with this functionality and inherit everything from it, except for the activity pin
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question