Android 5.1 中未显示小通知图标 (LOLLIPOP)

Android small notification icon not showing in 5.1 (LOLLIPOP)

我已经实施了推送通知并且它工作正常但是当我收到通知时小通知图标没有显示 在 LOLLIPOP大图标显示正常,当我收到通知时,状态栏上会显示一个方框 在 LOLLIPOP 我会 post我的代码,我的小通知图标图片和我的代码,请任何人指导我。

public void sendNotification(Context context,String message, String action) {
        try {
            int icon = R.drawable.notilogoboss;
            String title = context.getString(R.string.app_name);

            Intent intent = new Intent(context, MainActivity.class);
            intent.putExtra("message", message);
            intent.putExtra("action", action);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP| Intent.FLAG_ACTIVITY_SINGLE_TOP);

            PendingIntent pendingIntent = PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_UPDATE_CURRENT);

            Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context)
                    .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.logoboss))
                    .setSmallIcon(icon)
                    .setContentTitle(title)
                    .setWhen(System.currentTimeMillis())
                    .setContentText(message)
                    .setAutoCancel(true)
                    .setSound(defaultSoundUri)
                    .setDefaults(Notification.DEFAULT_ALL) // requires VIBRATE permission
                    .setStyle(new NotificationCompat.BigTextStyle().bigText(message))
                    .setContentIntent(pendingIntent);

            NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
            int notId = UUID.randomUUID().hashCode();
            notificationManager.notify(notId, notificationBuilder.build());

        } catch (Exception e) {
        }
    }

[![在此处输入图片描述][1]][1]

如 Android 通知下 Android 开发者网站的 5.0 行为更改所述:

通知在白色(或非常浅的)背景上用深色文本绘制,以匹配新的 material 设计小部件。确保您的所有通知在新配色方案下看起来都正确。如果您的通知看起来有误,请修复它们:

使用 setColor() 在图标图像后面的圆圈中设置强调色。更新或删除涉及颜色的资产。系统会忽略操作图标和主通知图标中的所有非 alpha 通道。您应该假设这些图标将仅显示 alpha。系统以白色绘制通知图标,以深灰色绘制操作图标。

http://developer.android.com/about/versions/android-5.0-changes.html.