i tried below code. But i'm not able to read the ring tone from ringtone preferences.
<RingtonePreference
android:title="@string/RING_TONE_SETTING"
android:summary="@string/RING_TONE_SETTING_DESCRIPTION"
android:ringtoneType="notification"
android:showSilent="true"
android:showDefault="true"
android:key="prefnotificationTone"/>
This is how i'm reading,
SharedPreferences preference = PreferenceManager.getDefaultSharedPreferences(this);
String strRingtonePreference = preference.getString("prefnotificationTone", "DEFAULT_SOUND");
Uri notification = Uri.parse(strRingtonePreference);
mMPlayer = MediaPlayer.create(getApplicationContext(), notification);
mMPlayer.start();
I'm getting DEFAULT_SOUND always.