【发布时间】:2017-09-11 07:27:38
【问题描述】:
您好,我已经在我的应用程序中实现了推送通知。 对于牛轧糖版本以下的设备,它工作正常并正确显示通知图标。
但是,它显示通知图标为方形,颜色为白色。
下面是我的代码:
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.app_icon)
.setColor(ContextCompat.getColor(getApplicationContext(),R.color.white))
.setContentTitle(strTitle)
.setContentText(messageBody)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(++NOTIFICATION_ID /* ID of notification */, notificationBuilder.build());
【问题讨论】:
标签: android push-notification notifications icons notification-icons