GoogleMap 快照未显示在 BigPictureStyle 通知中
GoogleMap snapshot doesn't show in BigPictureStyle Notification
所以我花了几天时间试图让 Google 地图快照显示在通知中。
我已经在我的 MyGcmListener class 中有了一个工作位图(当我在调试器中单击查看位图 link 时,可以从 Android Studio 中查看它)。现在我试图让它显示为 BigPictureStyle 通知位图,但我的运气失败了。这是代码:
NotificationCompat.Builder note = new NotificationCompat
.Builder(getApplicationContext())
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(content);
NotificationCompat.BigPictureStyle style
= new NotificationCompat.BigPictureStyle();
style.bigPicture(mapBit);
note.setStyle(style);
note.setAutoCancel(true);
note.build();
note.setContentIntent(resultPendingIntent);
notificationManager.notify(100,note.build());
这将产生一个没有附加任何位图的普通通知。
我哪里出错了?
经过 2 分钟优化我的搜索,这就是答案:
note.setPriority(Notification.PRIORITY_MAX);
所以我花了几天时间试图让 Google 地图快照显示在通知中。 我已经在我的 MyGcmListener class 中有了一个工作位图(当我在调试器中单击查看位图 link 时,可以从 Android Studio 中查看它)。现在我试图让它显示为 BigPictureStyle 通知位图,但我的运气失败了。这是代码:
NotificationCompat.Builder note = new NotificationCompat
.Builder(getApplicationContext())
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(content);
NotificationCompat.BigPictureStyle style
= new NotificationCompat.BigPictureStyle();
style.bigPicture(mapBit);
note.setStyle(style);
note.setAutoCancel(true);
note.build();
note.setContentIntent(resultPendingIntent);
notificationManager.notify(100,note.build());
这将产生一个没有附加任何位图的普通通知。
我哪里出错了?
经过 2 分钟优化我的搜索,这就是答案:
note.setPriority(Notification.PRIORITY_MAX);