推送通知图标Android

Rah*_*Ali 1 notifications android push-notification android-notifications

如何在android中的通知区域添加通知图标?我试试这个,但这会在通知区域显示一个空白空格.

mNotificationManager = (NotificationManager) this
                .getSystemService(Context.NOTIFICATION_SERVICE);        
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
                new Intent(this, Receive_Message_list.class), 0);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
                this)           
        .setSmallIcon(R.drawable.pushicon)
        .setContentTitle("MAY-I")
        .setStyle(new NotificationCompat.BigTextStyle()
                .bigText(notification_message))
                .setContentText(notification_message);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
Run Code Online (Sandbox Code Playgroud)

pet*_*tey 6

在Android 5.0上,图标通过一个彩色滤镜传递,使所有非透明像素为白色.

来自http://developer.android.com/design/patterns/notifications.html

使用颜色区分您的应用与其他应用.通知图标应仅为白色透明背景图像.