【发布时间】:2012-04-27 22:05:35
【问题描述】:
我现在正在使用通知让用户知道服务仍在运行。现在我想使用通知灯来提醒用户。 (因为它很花哨)
通知工作正常,但通知灯没有任何作用。其他应用程序可以在通知灯下正常工作,(gtalk,facebook)
这或多或少是添加这些标志的通知示例代码:
notification.ledARGB = 0xff00ff00;
notification.ledOnMS = 100;
notification.ledOffMS = 100;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
notification.flags |= Notification.FLAG_NO_CLEAR + Notification.FLAG_ONGOING_EVENT;
mNotificationManager.notify(NOTIFICATION_ID, notification);
和
notification.defaults |= Notification.DEFAULT_LIGHTS;
相反也不起作用。
我正在使用 Android 4.0 在 Galaxy Nexus 上进行调试,但应用的目标是 Android 2.3.3
编辑: 这可能是许可问题吗?如果是,是哪一个?我浏览了所有,发现没有匹配的通知灯权限。
【问题讨论】:
-
必填“你确定你有正确的通知灯权限”
-
好问题,我得到了吗?
-
仍然无法正常工作...文档没有列出任何所需的灯光权限
-
我的错误——你不需要权限。我会尝试将 ARGB 设置为 ffffffff 看看是否有区别
-
刚刚试了一下,没有变化。
标签: android android-notifications