这是我的代码:
Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_test_1);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_test_1)
.setContentTitle("My notification")
.setContentText("Sssssssssssssssssssss")
.setLargeIcon(largeIcon);
但它不会改变图像,它只是作为启动器图标保留,有什么问题吗?
答案 0 :(得分:0)
1 - 创建尺寸为128 * 128的照片。
2 - 使用以下代码替换代码:
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
Bitmap largeIcon = BitmapFactory.decodeResource(getResources(), R.drawable.Your photo with a size of 128 x 128);
.setSmallIcon(R.drawable.ic_test_1)
.setContentTitle("My notification")
.setContentText("Sssssssssssssssssssss")
.setLargeIcon(largeIcon);