I try to find solution here, but there are only solution for own/selected file, not for code when I call picker. I use following code when user press button:
Intent intent=new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, ringtone);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, ringtone);
startActivityForResult(intent , 1);
"ringtone" is the uri in which I am saving the picked tone in onActivityResult().
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 1:
ringtone = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
// Toast.makeText(getBaseContext(),RingtoneManager.URI_COLUMN_INDEX,
// Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
}
Hope it helps you. Hit answered if it does.