我已成功设置以下代码中的图片。
然而,我需要滚动通知消息以展开并查看图像。否则,在通知中不会显示。您能否查看我的代码并给我一些方法,使图像自动展开为完整尺寸,如下图所示:
mNotificationManager = (NotificationManager)
this.getSystemService(Context.NOTIFICATION_SERVICE);
Bitmap remote_picture = BitmapFactory.decodeResource(getResources(), R.drawable.bg1);
NotificationCompat.BigPictureStyle notiStyle = new NotificationCompat.BigPictureStyle();
notiStyle.bigPicture(remote_picture);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, openIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this).setSmallIcon(R.drawable.ic_stat_gcm)
.setContentTitle("Test")
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(data_msg_sort))
.setContentText("123")
.setStyle(notiStyle);
mBuilder.setContentIntent(contentIntent);
mBuilder.setSound(Settings.System.DEFAULT_NOTIFICATION_URI);
mBuilder.setAutoCancel(true);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
然而,我需要滚动通知消息以展开并查看图像。否则,在通知中不会显示。您能否查看我的代码并给我一些方法,使图像自动展开为完整尺寸,如下图所示: