2016-09-17 49 views
0

我尝试使用NotificationCompat.Builder显示通知:通知大图标总是绿色的机器人

NotificationCompat.Builder builder = new NotificationCompat.Builder(context); 
builder.setSmallIcon(R.drawable.ic_notification_small); 
builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_notification_large)); 
builder.setContentTitle(context.getString(R.string.push_notification_received_title)); 
builder.setContentText("message"); 

((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)) 
     .notify(MESSAGE_NOTIFICATION_ID, builder.build()); 

但是,相反大图标,我在Builder指向通知我得到的图标一个绿色的机器人(默认图标一样ic_luncher)。我想问题可能是我使用了xiaomi设备,但是一些应用程序如谷歌翻译显示正常的大图标。

+0

R.drawable.ic_notification_large它自己的图像或系统? –

+0

R.drawable.ic_notification_large是自己的图标 – Onregs

+0

你确定你为这个图标设置了很好的格式吗? –

回答

0

经过一段时间我发现了一个问题。一些shell(如xiaomi)从启动器图标中获取大量通知图标,因此需要更改启动器图标,重新安装应用程序并重新启动设备以使更改生效(因为图标放置在缓存中)。