设置铃声后继续相关操作

Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); 
intent
.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); 
intent
.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone"); 
intent
.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri) null); 
this.startActivityForResult(intent, 5); 

然后

@Override 
 
protected void onActivityResult(final int requestCode, final int resultCode, final Intent intent) 
 
{ 
     
if (resultCode == Activity.RESULT_OK && requestCode == 5) 
     
{ 
         
Uri uri = Intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI); 
 
         
if (uri != null) 
         
{ 
             
this.chosenRingtone = uri.toString(); 
         
} 
         
else 
         
{ 
             
this.chosenRingtone = null; 
         
} 
     
}             
 
} 

你可能感兴趣的:(操作)