Java – Notification led – color

I'm trying to experiment with LED colors on my Nexus One and I'm having trouble creating any LED lights (colors) with notifications The LED does not work I tested the hardware failure, which is not a problem This 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);

Who can tell me what I did wrong? TNX.

Solution

The problem is that the notification light will not be displayed until the phone is dimmed (the screen is off) Everything else (including code) is OK

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>