众所周知,自Android Lollipop以来,顶部栏中的通知图标为白色,c.f。这里Notification bar icon turns white in Android 5 Lollipop。
有趣的是,这不会发生在我的应用中。这是我的代码
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.mipmap.logo)
.setContentTitle(remoteMessage.getData().get("title"))
.setContentText(remoteMessage.getData().get("body"))
.setVibrate(pattern)
.setGroup(NEW_RESULT_GROUP)
.setAutoCancel(true);
R.mipmap.logo
是我用作初始图标的彩色徽标。我希望看到它的白色版本,或白色正方形,但出现的是所有颜色的完整徽标。
为什么会这样?
修改 我使用Firebase控制台/ Api发送通知。也许这是一个提示?
忘记提及minSDK和targetSDK。
minSdkVersion 14
targetSdkVersion 23
compileSdkVersion 23