- How dialogs are effectively handled in an Android application?
- How do you prevent a dialog from closing when a button is clicked?
How dialogs are effectively handled in an Android application?
Dialogs are normally used for notifications that should interupt the user and to perform short tasks that directly relate to the application in progress (such as a progress bar or a login prompt). The Dialog class is the base class for creating dialogs. However, you typically should not instantiate a Dialog directly.
How do you prevent a dialog from closing when a button is clicked?
If you wish to prevent a dialog box from closing when one of these buttons is pressed you must replace the common button handler for the actual view of the button. Because it is assigned in OnCreate(), you must replace it after the default OnCreate() implementation is called.