发送通知后:
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(context)
.setSmallIcon(myVarSmallIconResId)
.setContentTitle(myVarTitle)
.setContentText(myVarText);
//set bigPicture from Bitmap
Bitmap bitmap_image = BitmapFactory.decodeResource(context.getResources(), R.drawable.some_id);
NotificationCompat.BigPictureStyle s = new NotificationCompat.BigPictureStyle().bigPicture(bitmap_image);
s.setSummaryText("Summary text appears on expanding the notification");
s.setBigContentTitle("Big Content Title");
mBuilder.setStyle(s);
通知显示已展开。但是10秒后,它收缩了。
我如何管理这段时间?
答案 0 :(得分:0)
尝试将通知优先级设置为高。 mBuilder.setPriority(NotificationCompat.PRIORITY_HIGH)
如果扩展通知的优先级较低,而您有其他通知,则会收缩。