【发布时间】:2016-08-22 07:25:35
【问题描述】:
redmi MI 设备中没有出现通知图标,它出现在默认的 ic_launcher 中,而在所有其他设备中出现图像。API 22 和 Android 5.1.1 和 minsdk=15,target=24。我在许多其他手机上测试过没有问题,但在我的设备中,这个问题就在那里。你能摆脱这个问题吗?我的代码是
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setSmallIcon(R.drawable.home1); //icon appears in device notification bar and right hand corner of notification
builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.home1));
builder.setContentIntent(pendingIntent);
builder.setContentTitle(Title);
builder.setContentText(message);
builder.setSubText(subtext);
NotificationManager notificationManager = (NotificationManager) getSystemService(context.NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID, builder.build());
提前谢谢你
【问题讨论】:
-
你有不同版本的可绘制 home1 用于 hdpi、xhdpi 等吗?
-
是的,我有,但仍然没有图像图标不来......
-
请检查drawable home1的所有版本是否相似。
-
是的,我再次检查并没有所有 .png 图像都有不同的尺寸,比如 hdpi 有 20*20 而其他有其他...
标签: android performance push-notification notifications android-notifications