Android Notification LED doesn't use my Color

梦想的初衷 提交于 2019-12-03 07:54:21

You need to make sure all the defaults are overridden by setting

notification.defaults = 0;

Have a look on source below. Working perfectly on S3:

 NotificationCompat.Builder mBuilder =
                new NotificationCompat.Builder(ctx)
                        .setPriority(Notification.PRIORITY_HIGH)
                        .setSmallIcon(getNotificationIcon())
                        .setColor(0xff493C7C)
                        .setContentTitle(ctx.getString(R.string.app_name))
                        .setContentText(msg)
                        .setDefaults(Notification.DEFAULT_SOUND)
                        .setLights(0xff493C7C, 1000, 1000)
                        .setStyle(new NotificationCompat.BigTextStyle().bigText(styledMsg));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!