通知播放声音

NotificationManager nm_krf = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);

            Notification notification_krf = new Notification();

//直接播放系统的默认通知音

            notification_krf.defaults |= Notification.DEFAULT_SOUND;

//自定义

//notification.sound =Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.mm);

            nm_krf.notify(1, notification_krf);

你可能感兴趣的:(通知播放声音)