Android 更新可扩展通知,重新扩展它,即使在用户折叠它之后

Android 更新可扩展通知,重新扩展它,即使在用户折叠它之后,android,android-notifications,android-notification-bar,Android,Android Notifications,Android Notification Bar,我正在为照片上传创建一个带有进度条的BigPictureStyle通知,它大部分都正常工作 问题是:如果用户在通知托盘上折叠了通知,下次更新通知时,它将再次展开通知。这是我能控制的吗?我是否可以更改代码,以便系统将通知保留在用户放置的方式上 代码如下: NotificationCompat.Builder b = new NotificationCompat.Builder(App.the()); b.setSmallIcon(R.drawable.actionbar_icon);

我正在为照片上传创建一个带有进度条的
BigPictureStyle
通知,它大部分都正常工作

问题是:如果用户在通知托盘上折叠了通知,下次更新通知时,它将再次展开通知。这是我能控制的吗?我是否可以更改代码,以便系统将通知保留在用户放置的方式上

代码如下:

  NotificationCompat.Builder b = new NotificationCompat.Builder(App.the());
  b.setSmallIcon(R.drawable.actionbar_icon);
  b.setContentTitle(title);
  b.setContentText(content);
  b.setTicker(title);
  b.setWhen(time);
  b.setOnlyAlertOnce(true);
  b.setOngoing(true);
  b.setProgress(100, progress, false);

  NotificationCompat.BigPictureStyle s = new NotificationCompat.BigPictureStyle();
  s.setBigContentTitle(title);
  s.setSummaryText(content);
  s.bigPicture(photo);
  b.setStyle(s);

  b.setContentIntent( /* sets the activity to open */ );
  b.addAction( /* adds the cancel button */ );

  NotificationManager mn = ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE));
  mn.notify(ONGOING_NOTIFICATION, b.build());

注:我还尝试保留对生成器生成的
通知
对象的引用,并仅对
远程视图
进行更改,但未成功。

如果您的通知是显示的唯一通知,我相信通知栏会自动扩展通知,并在其他通知加入时将其折叠。取消该通知,您的通知将再次展开,因为它将恢复为唯一显示的通知。