I want the user to be able to choose a notification sound for my app so I use the code below:
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, my app's own notification sound isn't in the list. Google Hangouts, Calendar, and Facebook are in the list. I assume these programs have done something to register with android, but I cannot find any documentation on how to do this.