I want the user to be able to select a notification sound for my application, so I use the following code:
Intent ringtoneIntent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); ringtoneIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false); ringtoneIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false); ringtoneIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); ringtoneIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Choose"); ringtoneIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null); fragment.startActivityForResult(ringtoneIntent, REQUEST_RINGTONE);
Unfortunately, I do not have my own application notification sound in the list. The list includes Google Hangouts, Calendar, and Facebook. I assume that these programs did something to register in android, but I can not find documentation on how to do this.
source share