通知大图标总是绿色机器人

时间:2016-09-17 14:48:33

标签: android

我尝试使用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());

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

1 个答案:

答案 0 :(得分:1)

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