今天我的通知图标出现了奇怪的问题。
我做错了什么吗?
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消息服务...