我正在尝试在我的 Nexus One 上试验 LED 颜色,但我在创建带有通知的任何 LED 灯(颜色)时遇到了问题。 LED 灯不工作。我已经测试了硬件故障,这不是问题所在。这是代码。
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);
有人能告诉我我做错了什么吗?谢谢。
最佳答案
问题是通知灯直到手机变暗(屏幕关闭)才显示。其他一切(包括代码)都正常。
关于java - 通知 LED - 颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3560104/