主要是Uri的获取!!!Uri leave = null;
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), leave.parse("android.resource://" + getPackageName() + "/" +R.raw.audio));
r.play();
下面程式是在引發Notification功能時,播放指定的聲音
--------------------------------------------------------------------------------------------------------------------------------------
Url alert;
NotificationManager manger = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification();
notification.sound=alert.parse("android.resource://" + getPackageName() + "/" +R.raw.beepd);
manger.notify(1, notification);
--------------------------------------------------------------------------------------------------------------------------------------