【发布时间】:2015-07-15 21:23:09
【问题描述】:
由于某种原因,我无法让这个简单的概念在 Android Wear 上运行。我希望 Wear 上的通知具有纯色背景和我选择的颜色。这就是我想要做的:
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder
.setContentTitle("title")
.setSmallIcon(R.mipmap.ic_launcher)
.setContentText("Text")
.setColor(Color.YELLOW);
Notification notification = builder.build();
notificationManager.notify(123456, notification);
如您所见,我将通知颜色设置为黄色。这确实将通知的背景设置为手机上的黄色。但由于某种原因,我在 Android Wear 上看到的通知的背景颜色是绿色的。请参阅随附的屏幕截图。
我尝试使用 WearableExtender 扩展通知生成器,但它没有类似“setColor”的方法,只有“setBackground”。为什么 Wear 会忽略指定的通知颜色?它从哪里获取绿色背景颜色?如何覆盖该颜色?
【问题讨论】:
标签: android android-notifications wear-os