我想选择一个铃声并将其设置为我的应用程序的默认铃声,但不是整个移动设备?我怎么能这样做?
//fetch default Ringtone
Ringtone defaultRingtone = RingtoneManager.getRingtone(getActivity(),
Settings.System.DEFAULT_RINGTONE_URI);
//fetch current Ringtone
Uri currentRintoneUri = RingtoneManager.getActualDefaultRingtoneUri(getActivity()
.getApplicationContext(), RingtoneManager.TYPE_RINGTONE);
Ringtone currentRingtone = RingtoneManager.getRingtone(getActivity(), currentRintoneUri);
//display Ringtone title
output.setText(defaultRingtone.getTitle(getActivity())+" and " +
"Current Ringtone:"+currentRingtone.getTitle(getActivity()));
//play current Ringtone
currentRingtone.play();
return view;
}
}
我知道如何选择铃声,但我只需要在我的应用中调用