📜  播放默认消息铃声 android studio - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:47.396000             🧑  作者: Mango

代码示例1
try {
    Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);
    r.play();
} catch (Exception e) {
    e.printStackTrace();
}