Stealth Rabbi
Stealth Rabbi

Reputation: 10346

Default Ringtone Preference to silent

I have a ringtone preference in a preferences.xml that currently defaults to the system notification sound.

I'd like to default it to silent, but am having trouble finding the content URI to the silent sound.

    <RingtonePreference
            android:defaultValue="content://settings/system/notification_sound"
            android:key="@string/pref_alarm_tone_scan_notification_sound"
            android:ringtoneType="notification"
            android:showDefault="true"
            android:showSilent="true"
            android:title="@string/pref_alarm_notification_sound_title" />

In a subclass of Application, I am setting the default values from the xml file as follows:

// apply defaults as stored in preferences.xml
PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

Upvotes: 0

Views: 1252

Answers (1)

Hải Phong
Hải Phong

Reputation: 5144

the silent sound is an empty string

android:defaultValue=""

Upvotes: 3

Related Questions