The custom Dialog said that the activity's theme could be defined as Dialog style, making the activity look like a dialog box (Dialog), and custome title description if the title bar is customized. The dialog example also uses the dialog style to display the activity, and sets the icon for the titlebar.
Dialogactivity uses the Android system-defined dialog Theme:
<activity android:name= ". App. Dialogactivity "
Android:label= "@string/activity_dialog"
Android:theme= "@android: Style/theme.dialog" >
<intent-filter>
< action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.SAMPLE_CODE"/>
</intent-filter>
</activity>
To set the icon for TitleBar, you also need to set the Windows Feature ID method:
Requestwindowfeature
(Window.feature_left_icon);
...
GetWindow (). Setfeaturedrawableresource (Window.feature_left_icon,
Android. R.drawable.ic_dialog_alert);
In addition to Window.feature_left_icon, the Windows.feature_right_icon is also defined to set the icon that is displayed to the right of the titlebar.