다음과 같이 하시면 될 것 같네요.
1. Picker를 startActivityForResult()로 호출
private void showRingtonePickerDialog() {
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select ringtone for notifications:");
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_NOTIFICATION);
startActivityForResult(intent, 777);
}
2. onActivityResult() 콜백 함수에서 Uri 읽음.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 999:
Uri uri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
if (uri != null) {
String ringtonePath = uri.toString();
Toast.makeText(getApplicationContext(), "ringtone="+ringtonePath, Toast.LENGTH_LONG).show();
}
break;
default:
break;
}
}
}