App->activity->custom Dialog example uses an activity to implement a custom dialog box. The class customdialogactivity itself is nothing special. The key point is its definition in Androidmanifest.xml:
<activity android:name= ". App. Customdialogactivity "android:label=" @string/activity_custom_dialog "android:theme=" @style/theme.customdialog " >
<intent-filter>
< action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.SAMPLE_CODE"/>
</intent-filter>
</activity>
Customdialogactivity used the Customdialog style (Theme).
Android apps can use custom interface styles (Theme), Theme for a set of related style definitions that can be applied to an activity or the entire application. One advantage of using theme is that you can define a uniform interface style for the entire application (uniform background color, font, etc.).
Defining Theme and defining style, you must define a/res/values subdirectory in which the root element is named resources, and Theme and style differ in that the Theme is applied to the activity and application Style is applied to a single view. The method of definition is consistent. The style definition supports inheritance, which means that you can define a new style based on either a system-defined style or a previously defined style:
such as the Theme.customdialog definition is based on the Android dialog style (parent) and only modified Windowsbackground properties, using a brown background.
<style name= "Theme.customdialog" parent= "Android:style/theme.dialog" >
<item name= "Android:windowbackground" > @drawable/filled_box</item>
</style>