gpt4 book ai didi

Android 通知 LED 不使用我的颜色

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:04:04 25 4
gpt4 key购买 nike

我正在尝试使用一个通知,该通知也使用我的 S3 上的通知 LED,但出于某种原因,颜色将始终为蓝色(我想这是默认设置?)。我尝试使用不同的颜色,但没有任何变化。其他应用程序(如 Whatsapp、Gmail 和 Facebook 在显示不同颜色的光时没有问题)。

Notification.Builder noteBuilder = new Notification.Builder(context)
.setAutoCancel(true)
.setPriority(Notification.PRIORITY_DEFAULT)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(ContentTitle)
.setContentText(ContentText)
.setLights(Color.YELLOW, 500, 500)
;

Intent noteIntent = new Intent(context,HoofdScherm.class);
PendingIntent notePendingIntent = PendingIntent.getActivity(context, 0, noteIntent, PendingIntent.FLAG_CANCEL_CURRENT);
noteBuilder.setContentIntent(notePendingIntent);

Notification note = noteBuilder.build();
note.ledARGB = Color.YELLOW;
NotificationManager mgr = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
mgr.notify(0,note);

最佳答案

您需要确保通过设置覆盖所有默认值

notification.defaults = 0;

关于Android 通知 LED 不使用我的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14953793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com