Notification LED - Color

I'm trying to experiment with LED colors on my Nexus One, and I'm having trouble creating any LED (color) notification color. LED indicator does not work. I tested a hardware malfunction and this is not a problem. Here is the code.

    Notification notification = new Notification(R.drawable.icon, tickerText, System.currentTimeMillis());

    notification.ledARGB = Color.WHITE;
    notification.ledOnMS = 300;
    notification.ledOffMS = 1000;
    notification.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL;
    //notification.defaults = Notification.DEFAULT_ALL;

    notification.setLatestEventInfo(this, getText(R.string.tekst1),
                   text, makeIntent(R.drawable.icon));

    notificationManager.notify(R.layout.main, notification);

Can someone tell me what I'm doing wrong? Tnx.

+3
source share
3 answers

The problem is that the notification indicator does not appear until the mobile phone turns dark (the screen turns off). Everything else (including code) is fine.

+7
source

... rgb (254, 254, 254). , 255 ... - . rgb G1, , . , . - , , , . , . , rgb (200, 235, 255) . , ...

, , ! (Colour.RED,.GREEN ect...) . - . , G1.

Kee

0

I think that for Nexus One you should actually start the phone, and then after installing some additional software (the default is cyanogenmod), your trackball will actually show the color that the developer sends to the LED. Otherwise, it will always be white.

0
source

Source: https://habr.com/ru/post/1761383/


All Articles