简体   繁体   中英

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

the code work in an app, but doesn't work in another. The led doesn't flash.
Any answer will be appreciated.

sorry for my careless, the reaseon is this one line code:

notification.defaults = Notification.DEFAULT_ALL;

it means that all the setting, include Light, Sound, Vibration, all follow the system setting.

because of this, this code doesn't work.

notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.ledARGB = Color.BLUE;
notification.ledOnMS = 1000; 
notification.ledOffMS = 1000;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM