Android Ringtone picker list with default option selected

Adrian Olar picture Adrian Olar · Sep 11, 2014 · Viewed 9.7k times · Source

I am trying to display a window picker dialog in android with the default selection to be instead of "None" how it is currently, to be selected the default phone's alarm/ringtone.

Here is the code I tried:

Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,
                    RingtoneManager.TYPE_NOTIFICATION
                            | RingtoneManager.TYPE_RINGTONE);
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
            intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI,
                    RingtoneManager
                            .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
            startActivityForResult(intent, 0);

See the screenshot for details.enter image description here

Answer

user3863229 picture user3863229 · Sep 15, 2014

Have you tried this ? Ringtone picker - radio button set