In Android, the help, about, and author prompt pages are frequently used.
Pages like this:
This page can be designed through the alertdialog dialog box.
Design an aboutdialog class to inherit from alertdialog
Public class aboutdialog extends alertdialog {public aboutdialog (context) {super (context); final view = getlayoutinflater (). inflate (R. layout. about, null); setbutton (context. gettext (R. string. close), (onclicklistener) null); seticon (R. drawable. icon_about); settitle ("joke v1.0.0"); setview (View );}}
Corresponding XML file
1. layout file about. xml
<? 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
<String name = "help_dialog_text"> <I> author: Kong Shan is not empty </I> \ n <I> contact: ajie191@163.com </I> \ n <B> super joke --- collected more than 2000 types of jokes, let you laugh all day! You can also send jokes to your friends through text messages! </B> \ n <B> if you have any suggestions or feedback, contact the author at any time. </B> </string>
Then, callCodeThe dialog box is displayed.
New aboutdialog (this). Show ();