【发布时间】:2016-06-08 20:52:41
【问题描述】:
根据下面的代码,我创建了一个可扩展的通知。 私人无效横幅通知(){ 通知前台注; RemoteViews bigView = new RemoteViews(getApplicationContext() .getPackageName(), R.layout.banner_notif);
Bitmap icon = BitmapFactory.decodeResource(getResources(),
R.drawable.featuredimagehandler);
NotificationCompat.Builder mNotifyBuilder = new NotificationCompat.Builder(
this);
foregroundNote = mNotifyBuilder.setContentTitle("Title")
.setContentText("Description")
.setSmallIcon(R.drawable.app_icon).setLargeIcon(icon).build();
foregroundNote.bigContentView = bigView;
NotificationManager mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotifyManager.notify(2, foregroundNote);
}
据此document
仅当通知展开时才会显示通知的大视图,这发生在通知位于通知抽屉顶部时,或者当用户使用手势展开通知时。
问题是当这个通知放在顶部时,它没有展开。
【问题讨论】:
-
您找到解决方案了吗?
标签: android notifications android-notifications