2011-11-29 5 views
9

は、私は私の好みの画面にこのコードを持って、RingtonePreferenceデフォルト値

<RingtonePreference 
    android:key="notification_sound" 
    android:ringtoneType="notification" 
    android:title="Notification Sound" 
    android:showDefault="true" 
    android:showSilent="true" /> 

私はそれを行うことができますどのように、XMLでDefault Notification SoundにRingtonePreferenceのデフォルト値を設定したいですか?私は解決策を見つけた

おかげ

+7

私はSO上でこれを見つけた: [RingtonePreferenceのDefaultValue] [1] [1]:http://stackoverflow.com/questions/4235018/can-i-insert-a-androiddefaultvalue-trait-for-ringt ** 'Inspect Code ...' **を実行した後、Android Sudio Analyzeメニューで**シンボルを解決できません:// settings/system/notification_sound''を実行した後、1つの参照を介して – Joe

答えて

31

は、Joeのおかげで、はdefaultValueでなければなりません:

android:defaultValue="content://settings/system/notification_sound" 
+0

@ d-a-v-o-o- –