android 怎么获取到系统的铃声

2025-03-24 14:14:28
推荐回答(1个)
回答(1):

参考下面代码:
MediaPlayer mp = new MediaPlayer();
try {
mp.setDataSource(this, RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
mp.prepare();
mp.start();
} catch (Exception e) {
e.printStackTrace();
}