Oreo (8.0) status bar notification icon all white

只谈情不闲聊 提交于 2019-12-24 07:39:03

问题


I'm currently having problems with Android Oreo showing the notification icon correctly in the status bar and on the notification itself (screenshots provided below).

To create the icons, I am using Android 3.1, right clicking on the res folder and choosing New > Image Asset. Within that, I'm uploading an all white png (as per docs) and selecting a red background as per screenshot:

Within the AndroidManifest.xml, I set the icon like this:

<application ... android:icon="@mipmap/ic_launcher"

The actual App looks correct, but the notification icon does not show up correctly.

Notification icon errors:


回答1:


You need to create icon as per this

Also you need to add

<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/statusbar_notification" />

in AndroidManifest



来源:https://stackoverflow.com/questions/49736012/oreo-8-0-status-bar-notification-icon-all-white

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!