notification 发起音乐背景灯以及震动的使用
我本来打算全部使用这几种效果 但是呢 只有震动一种效果,不知道为啥权限也加了
也许每次只能用一个吧
+ start;?
?
? ? ? ? Intent notificationIntent = new Intent(context, ViewSchedules.class);?
? ? ? ? PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);?
?
? ? ? ? notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);?
?
? ? ? ? notification.ledARGB = 0xff00ff00;?
? ? ? ? notification.ledOnMS = 300;?
? ? ? ? notification.ledOffMS = 1000;?
? ? ? ? notification.flags |= Notification.FLAG_SHOW_LIGHTS;?
?
?
?
? ? ? ? notification.sound = Uri.parse("android.resource://com.robinwilson.radioguide/" +R.raw.chimes);?
? ? ? ? notification.vibrate = new long[] { 0, 300, 200, 300, 400, 300 };?
?
? ? ? ? // Actually send the notification?
? ? ? ? nm.notify(0, notification);?