【Android】开启手机提示音

来源:互联网 发布:创游网络 编辑:程序博客网 时间:2024/05/03 12:37
Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);  Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);  r.play();   

直接copy即可出声~


RingtoneManager.TYPE_NOTIFICATION为系统提示音;

RingtoneManager.TYPE_ALARM为系统闹铃声;

共有四个类型,这里只列举的两个,除了这四个应该还有其他声音,没有继续看
0 0