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设备,但是一些应用程序如谷歌翻译显示正常的大图标。
R.drawable.ic_notification_large它自己的图像或系统? –
R.drawable.ic_notification_large是自己的图标 – Onregs
你确定你为这个图标设置了很好的格式吗? –