【发布时间】:2017-03-17 05:44:39
【问题描述】:
我今天遇到了一个奇怪的通知图标问题。
我是不是做错了什么?
Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.icon_notification)
.setContentTitle(this.getString(R.string.notification_title))
.setContentText(this.getString(R.string.notification_text))
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);
这是我的图标图片(从这里 https://material.io/icons/#ic_photo 新下载的): http://image.noelshack.com/fichiers/2016/44/1478185219-icon-notification.png
我错过了什么吗?
作为记录,我使用的是 SDK 24,目前只创建了 hdpi 资源文件夹。
编辑 #1:我添加了 ldpi、mdpi 和 xhdpi 图标,没有任何变化...
编辑#2:为了更精确,我正在尝试从服务创建此通知... FCM 消息传递服务...
【问题讨论】:
标签: android notifications icons