How to make functioning Preference Screen?

我怕爱的太早我们不能终老 提交于 2020-01-14 06:23:27

问题


I have made a Preference Screen which I want to make function able.

Sorry I can't post any Screen Shot of the Preference Screen as I have not gain required Reputation.

Here's my PreferenceScreen code:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

    <PreferenceCategory android:title="Notifications">
        <RingtonePreference
            android:summary="Choose a Ringtone"
            android:title="Notification Ringtone"
            android:key="ringtonePref" />
        <ListPreference
            android:title="Notification Timer"
            android:summary="Select when to Notify"
            android:dialogTitle="Show Notification after every:"
            android:positiveButtonText="OK"
            android:negativeButtonText="Cancel"
            android:entries="@array/entries"
            android:entryValues="@array/entries"
            android:key="listPrefs" />
        <ListPreference
            android:title="LED Color"
            android:summary="Choose LED Color"
            android:positiveButtonText="OK"
            android:negativeButtonText="Cancel"
            android:entries="@array/colors"
            android:entryValues="@array/colors"
            android:key="listPrefs2" />
        <CheckBoxPreference
            android:title="LED"
            android:defaultValue="true"
            android:summary="Flash LED or Not"
            android:key="checkBoxPrefs2"/>
        <CheckBoxPreference
            android:title="Vibrate"
            android:defaultValue="true"
            android:summary="Vibrate on receiving Notification"
            android:key="checkBoxPrefs3" />
    </PreferenceCategory>

</PreferenceScreen>

for ex - I want that when user select the time interval to be notified it should be get notified at that time interval only & like when user uncheck the Vibration, the vibration should stop.

I hope you all have understood what I i want.

Please HELP!

来源:https://stackoverflow.com/questions/24728234/how-to-make-functioning-preference-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!