A notification icon does not appear on the status bar in candy

Here is the code that I use to show a notification.

notification = new Notification.Builder(context).setContentIntent(contentIntentTwo)
                        .setContentTitle("App name").setSmallIcon(R.drawable.ic_launcher).setLargeIcon(notificationLargeIconBitmap).getNotification();

The notification and notification icon is displayed in the notification drop-down box, but not in the status bar in the candy.

Here's what it looks like a candy:

enter image description here

This only happens on candy.

+4
source share
2 answers

, . , ( png). , lollipop , .

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
            .setContentTitle(title)
            .setContentText(body)
            .setPriority(2)
            .setContentIntent(pendingIntent);
    mBuilder.setAutoCancel(true);
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
        mBuilder.setSmallIcon(R.mipmap.ic_launcher_transparant);
    }else{
        mBuilder.setSmallIcon(R.mipmap.ic_launcher);
    }

https://medium.com/swarm-nyc/complexion-reduction-a-new-trend-in-mobile-design-cef033a0b978#.fblfw0ohi

0

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


All Articles