I am trying to play a ringtone which is selected from a RingtonePreference. How can I play it?
Here is my xml file code
<RingtonePreference
android:title="Choose Alarm"
android:key="ringtone"
android:summary="this is summary"
></RingtonePreference>
Here is what I am doing in java
SharedPreferences getAlarms = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
String alarms = getAlarms.getString("ringtone", "default ringtone");
When I use toast like this
Toast.makeText(getApplicationContext(), alarms, Toast.LENGTH_LONG).show();
Then it shows this kind of path
content://media/internal/audio/media/50
But I do not know how to play this one.
Help Please.