获取设备的铃声并通过活动运行它

时间:2015-04-14 13:56:14

标签: android device ringtone

如何获取Android设备的铃声并将其设置为Activity(当活动启动设备的铃声自动运行时)

1 个答案:

答案 0 :(得分:0)

    Uri defaultRintoneUri = RingtoneManager.getActualDefaultRingtoneUri(getActivity().getApplicationContext(), RingtoneManager.TYPE_RINGTONE);
    Ringtone defaultRingtone = RingtoneManager.getRingtone(getActivity(), defaultRintoneUri);
    defaultRingtone.play();