To prevent dialog box from getting dismissed on back key pressed use this
dialog.setCancelable(false);
And to prevent dialog box from getting dismissed on outside touch use this
dialog.setCanceledOnTouchOutside(false);
More Related Contents:
- Creating new Android (Java ) file in Existing Android package [closed]
- Start another activity with button
- How to pass an object from one activity to another on Android
- Finish all previous activities
- How do you use Intent.FLAG_ACTIVITY_CLEAR_TOP to clear the Activity Stack?
- Detect touch press vs long press vs movement?
- How to use interface to communicate between two activities
- How do you pass a string from one activity to another? [duplicate]
- Android – Activity Constructor vs onCreate
- How to start Activity in adapter?
- How to cancel an Dialog themed like Activity when touched outside the window?
- Android Studio cannot resolve symbol but code executes correctly
- Android Unable to instantiate activity: Didn’t find class on path
- Android Center text on canvas
- How can I start a new android activity using class name in a string?
- DeadObjectException on android app
- Android Call a method from another class
- Android: Unable to find explicit activity class… startActivity from a PreferenceActivity
- How to navigate from one screen to another screen
- The activity must be exported or contain an intent-filter
- How can I pass values between a Dialog and an Activity?
- Android “single top” launch mode and onNewIntent method
- resuming an activity from a notification
- What’s the difference between this and Activity.this
- Public static variables and Android activity life cycle management
- how to programatically theme an activity to be like a dialog?
- Android – Dynamically Get the Current Activity in Foreground
- PopUp dialog Android from background thread
- IllegalArgumentException: Unknown URL content:// CONTENT
- Android: Navigation-Drawer on all activities