通知指示灯不工作
notification led doesn't work
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = Color.BLUE;
notification.ledOnMS = 1000;
notification.ledOffMS = 1000;
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notificationManager.notify(notifyId, notification);
该代码在一个应用程序中有效,但在另一个应用程序中无效。灯不闪。
任何答案将不胜感激。
对不起我的粗心,原因是这一行代码:
notification.defaults = Notification.DEFAULT_ALL;
表示所有的设置,包括灯光、声音、振动,都按照系统设置。
因此,此代码不起作用。
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = Color.BLUE;
notification.ledOnMS = 1000;
notification.ledOffMS = 1000;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = Color.BLUE;
notification.ledOnMS = 1000;
notification.ledOffMS = 1000;
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notificationManager.notify(notifyId, notification);
该代码在一个应用程序中有效,但在另一个应用程序中无效。灯不闪。
任何答案将不胜感激。
对不起我的粗心,原因是这一行代码:
notification.defaults = Notification.DEFAULT_ALL;
表示所有的设置,包括灯光、声音、振动,都按照系统设置。
因此,此代码不起作用。
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = Color.BLUE;
notification.ledOnMS = 1000;
notification.ledOffMS = 1000;