Showing flashing LED for foreground activity / screen on

后端 未结 1 1973
不知归路
不知归路 2021-01-14 06:08

I\'m trying to turn the LED-flashing on for my activity in foreground, but it works only when the screen is off.

Is it possible to turn the LED on for active activit

1条回答
  •  野的像风
    2021-01-14 07:00

    At first Android LED indicator is very hardware dependent. Second - there is no API for managing LED instead of Notification class with its FLAG_SHOW_LIGHTS flag and several flags for managing flash duration and LED color which you use. Notification is a message you can display to the user outside of your application's normal UI the primary purpose of LED indicator is to present additional notification information for the user when the screen is off. So the answer is definite NO. The LED will only start flashing if your screen is off and it’ll stop when you turn it back on. And there is no way to turn on and off LED when you want and to turn it when any of the application activities is in foreground, because it is managed by the OS internally.

    0 讨论(0)
提交回复
热议问题