Using Activities as Dialogs
Dialogs offer a simple and lightweight technology for displaying screens, but there will be times when you need more control over the content and life cycle of your Dialog box.
The solution is to implement it as a full Activity. By creating an Activity, you lose the lightweight nature of the Dialog class, but you gain the ability to implement any screen you want and full access to the Activity life-cycle event handlers.
So, when is an Activity a Dialog? The easiest way to make an Activity look like a Dialog is to apply the android:style/Theme.Dialog theme when you add it to your manifiest, as shown in the following XML snippet: