In Android, you often use help, about, and the author's tips page.
A page like this:
Such a page, we can through the Alertdialog dialog box to design.
Design a Aboutdialog class to inherit from Alertdialog
Copy Code code as follows:
public class Aboutdialog extends Alertdialog {
Public Aboutdialog {
Super (context);
Final View view = Getlayoutinflater (). Inflate (R.layout.about,
NULL);
Setbutton (Context.gettext (R.string.close), (onclicklistener) null);
SetIcon (r.drawable.icon_about);
Settitle ("Super joke v1.0.0");
Setview (view);
}
}
The corresponding XML file
1. Layout layout file About.xml
Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<framelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Fill_parent" android:layout_height= "Wrap_content" >
<scrollview xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Fill_parent" android:layout_height= "Fill_parent" >
<textview android:layout_height= "Fill_parent"
Android:layout_width= "Fill_parent" android:text= "@string/help_dialog_text"
android:padding= "6dip" android:textcolor= "#FFFFFF"/>
</ScrollView>
</FrameLayout>
2, Strings.xml
Copy Code code as follows:
<string name= "Help_dialog_text" >
<i> Author: Yun-Habitat Community </i>
\ n
\ n
<i> Contact:www.jb51.net</i>
\ n
\ n
<b> Super Jokes---collected more than 2000 different types of jokes, making you laugh all day! You can also send jokes through SMS to your friends to share Oh! </b>
\ n
\ n
<b> any suggestions or feedback can be contacted at any time by the author </b>
</string>
You can then display the dialog box in the page call code
New Aboutdialog (This). Show ();