Search this blog

How to use dialogue methods of activity class

Methods and their purpose

(1)Activity.showDialog()      
Shows a dialog, creating it if necessary.
 
(2)Activity.onCreateDialog()
Is a callback when a dialog is being created for the first time and added to the activity dialog pool.
 
(3)Activity.onPrepareDialog()
Is a callback for updating a dialog on-the-fly.Dialogs are created once and can be used many times by an activity. This callback enables the dialog to be updated just before it is shown for each showDialog() call.
 
(4)Activity.dismissDialog()        
Dismisses a dialog and returns to the activity. The dialog is still available to be used again by calling showDialog() again.
 
(5)Activity.removeDialog()  
Removes the dialog completely from the activity dialog pool.

Activity classes can include more than one dialog, and each dialog can be created
and then used multiple times.

You can also create an entirely custom dialog by designing an XML layout file and
using the Dialog.setContentView() method. To retrieve controls from the dialog
layout, you simply use the Dialog.findViewById() method.

0 comments:

Post a Comment