首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

notification 发起音乐背景灯以及震动的施用

2012-08-27 
notification 发起音乐背景灯以及震动的使用我本来打算全部使用这几种效果 但是呢 只有震动一种效果,不知

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);?

1 楼 mesmes 2010-08-25   背景灯可以使用:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

热点排行