The example in this article describes how the Android implementation sets an activity to a window style. Share to everyone for your reference, specific as follows:
1. Add the following code to the Style.xml file in the Res/value folder:
<style name= "theme.floatactivity" parent= "Android:style/theme.dialog" >
<!--float_box for us to define the window background, This is not necessary.-->
<item name= "Android:windowbackground" > @drawable/float_box</item>
</style >
2. Under the Res/drawable folder, create a new Float_box.xml file with the following code:
<?xml version= "1.0" encoding= "Utf-8"?> <shape xmlns:android=
"http://schemas.android.com/apk/res/" Android ">
<solid android:color=" #ffffff "/>
<stroke android:width=" 3DP "android:color=" # ff000000 "/>
<corners android:radius=" 3DP "/> <padding android:left=
" 10DP "android:top=" 10DP " android:right= "10DP" android:bottom= "10DP"/>
</shape>
3. In the statement of activity in Androidmainifest.xml, add
Android:theme= "@style/theme.floatactivity"
The effect is as follows:
More interested readers of Android-related content can view this site: "Introduction to Android Development and advanced Course", "Android Service Component Usage Summary", "Android Basic component Usage Summary" and "Android Control usage Summary"
I hope this article will help you with the Android program.