I have the following code to select a ringtone:
private void selectTone(int requestCode) {
Uri uriDefault = RingtoneManager.getActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_NOTIFICATION);
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, uriDefault); // System.DEFAULT_NOTIFICATION_URI
// intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null);
this.startActivityForResult(intent, requestCode);
}
Generally this seems to work.
However, on my Nexus 4 with Android 4.2.2 (Cyanogenmod 10.1.3) I have the following issue:
- Silent tone is shown, while it is set on FALSE.
- Default tone can be selected, but returns NULL as ringtone. Thus not distinguishable from Silent, which by default returns NULL.
Since this is my only real device, is this a known problem from cyanogenmod?
0 comments:
Post a Comment