扩展通知在10秒后崩溃,如何增加此值?

时间:2016-07-20 10:36:03

标签: android android-notifications

发送通知后:

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秒后,它收缩了。

我如何管理这段时间?

1 个答案:

答案 0 :(得分:0)

尝试将通知优先级设置为高。 mBuilder.setPriority(NotificationCompat.PRIORITY_HIGH)如果扩展通知的优先级较低,而您有其他通知,则会收缩。