3
我試圖在前景中爲我的活動開啓LED閃爍,但它僅在屏幕關閉時才起作用。在前景中顯示閃爍的LED用於前景活動/屏幕
是否可以打開LED以進行活動,同時屏幕上?
我的代碼:
protected void led() {
Notification notif = new Notification();
notif.ledARGB = 0xFF0000ff;
notif.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_ONGOING_EVENT;
notif.ledOnMS = 800;
notif.ledOffMS = 200;
notificationManager.notify(LED_NOTIFICATION_ID, notif);
}