setLargeIcon(Bitmap bitmap)
по определению принять Bitmap
или перегруженную реализацию setLargeIcon (Icon icon)
принять экземпляр Icon
.
Notification.Builder setLargeIcon (Bitmap b)
Установить большой значок следующим образом.
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
.setSmallIcon(R.mipmap.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(),
R.mipmap.ic_launcher))
.setContentTitle("Title")
.setContentText("Hi")
.setAutoCancel(true)
.setContentIntent(pendingIntent);
NotificationManager notificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0 , notificationBuilder.build());
Для приложений, использующих Android O. NotificationCompat.Builder(Context context)
устарел. Вы должны использовать конструктор с параметром channelId, см. Документация :
NotificationCompat.Builder (Контекстный контекст, String channelId)