I've created a dialog for selecting a notification sound for an app. I'm querying the notification sounds by getting a cursor from the RingtoneManager:
RingtoneManager manager = new RingtoneManager(this);
manager.setType(RingtoneManager.TYPE_NOTIFICATION);
Cursor cursor = manager.getCursor();
I then store the full path to it by concatenating the sound path with the name.
This works fine when I set the selected sound as the notification sound but I can't get media player to play it on selection:
MediaPlayer mp = MediaPlayer.create(this, Uri.parse(path));
This throws an IllegalStateException:
java.lang.IllegalStateException: Unknown URL: content://media/internal/audio/media/Capella
Any ideas on how to get the correct path to a specific notification sound?