Preferences for Android (3) edittextpreference/ringtonepreference

Source: Internet
Author: User

Edittextpreference:

:

This dialog box is displayed when you click Enter name on the homepage.

Code:

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <preferencescreen <br/> xmlns: Android = "http://schemas.android.com/apk/res/android" <br/> Android: Key = "edittext_screen" <br/> Android: title = "screen title" <br/> Android: Summary = "Brief description" <br/> </P> <p> <edittextpreference <br/> Android: dialogtitle = "enter your name:" <br/> Android: Key = "edittitlepreference" <br/> Android: Summary = "Brief description" <br/> Android: title = "input name" <br/> </edittextpreference> <br/> </preferencescreen> <br/>

-------------------------------------------------------------------

Ringtonepreference:

Code:

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <preferencescreen <br/> xmlns: Android = "http://schemas.android.com/apk/res/android" <br/> Android: Key = "edittext_screen" <br/> Android: title = "screen title" <br/> Android: Summary = "Brief description" <br/> <! -- <Br/> Android: ringtonetype: Set the ringing mode, including ringtone, notification, alarm, and all. <br/> Android: show whether showsilent is muted. <br/> note, if there is no ringtone in the simulator, we can add it by ourselves. Copy the music to the SD card, go to the android Media Player application, select the music, <br/> click menu, then select uses as ringtone </P> <p> --> <br/> <ringtonepreference <br/> Android: Key = "ringtonepreference" <br/> Android: summary = "Brief description" <br/> Android: Title = "Select system ringtone" <br/> Android: ringtonetype = "alarm" <br/> Android: showsilent = "true" <br/> </ringtonepreference> </P> <p> </preferencescreen>

Let's take a look at how XML is stored in the background.

<? XML version = '1. 0' encoding = 'utf-8' standalone = 'Yes'?>
<Map>
<String name = "ringtonepreference"> content: // settings/system/alarm_alert </string>

</Map>
Here we should note that the value of ringtonepreference is a URI string.

Bytes ------------------------------------------------------------------------------------

 

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.