Question

I'm trying to experiment with LED colors on my Nexus One and i'm having problems with creating any LED-light (color) with notification. LED-light isn't working. I have tested hardware malfunction and that isn't the 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 somebody tell me what am I doing wrong? Tnx.

Was it helpful?

Solution

The problem is that notification light isn't shown until mobile phone goes dark (screen turns off). Everything else (including code) is OK.

OTHER TIPS

Sepration again... I would try to set the Color like rgb(254, 254, 254). Maybe the 255 is an indicate for...something else. I actually tried a custom rgb on my G1 and the results were not what I've expected. There is a multi-colour LED, but you almost cannot see the differences between the base and the custom colours. I made something between magenta and blue and the result were a partly magenta, partly blue LED, not really mixed. Maybe its just not that visible on such a small LED. For example rgb(200, 235, 255) should be a very bright blue. It turned out like magenta...

Its a matter of trying out and, of course, trying it on several differnt phones! The base colours (Colour.RED, .GREEN ect...) seem like right all the time. But those custom ones are buggy or just not that good looking. At least on the G1.

So far, Kee

I think for Nexus One you have to actually root the phone, then after installing some extra software (cyanogenmod has it by default) your trackball will actually show the color the developer is sending for the LED. Otherwise it will just always be white.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top