Parse help in Android, about, tips for authors, helps, and so on page _android

Source: Internet
Author: User
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 ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.