小编Luc*_*len的帖子

Android Notification LED不使用我的Color

我正在尝试使用也在我的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);
Run Code Online (Sandbox Code Playgroud)

notifications android led

8
推荐指数
1
解决办法
9492
查看次数

标签 统计

android ×1

led ×1

notifications ×1