Removing secondary icon from android notification

How to remove a smaller secondary icon in the lower right corner of the notification? Since notification requires calling the setSmallIcon method, we cannot just remove the call for this method.

Is there a way to remove the secondary icon by saving it in the status bar? Do we need to call setStyle and set up a custom style for the notification?

+6
source share
1 answer

I got rid of it (works for Android 5 and below):

NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); Bitmap notificationLargeIconBitmap = BitmapFactory.decodeResource( context.getResources(), R.drawable.notification_icon_big); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_notification_systray) //.setLargeIcon(notificationLargeIconBitmap) .setContentTitle(context.getString(R.string.app_name)) .setContentText(msg) .setColor(context.getResources().getColor(R.color.blue)) .extend(new NotificationCompat.WearableExtender().setBackground(notificationLargeIconBitmap)); 
0
source

Source: https://habr.com/ru/post/973786/


All Articles