android - 如何更改通知徽章 Android
问题描述
我已经为我的应用程序设置了 Firebase 云消息传递,但图标没有改变为我需要的样子。我查看了开发人员文档,并关注了这篇文章:Android Studio 中的 Q 更改通知图标,但它仍然没有改变。我想更改firebase的图标以及应用程序显示的每个通知,请帮助!
谢谢!
解决方案
这个答案应该适用于 Firebase 通知:Q Change notification icon in Android Studio
对于您自己创建的通知,只需使用Notification.Builder#setSmallIcon/setLargeIcon
:
Notification notification = new Notification.Builder(mContext)
...
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.build();
推荐阅读
- mysql - 如何扩展 CI3 $this->db
- php - 第一次 PHP 大学作业 - 使用隐藏值传递参数?
- c# - 具有异步等待的全局互斥锁
- base64 - 使用 node.js 中的 slugId 的 UUID 的 base64 表示
- iis - IIS 上的 URL 重写反向代理仅在其自身的服务器上工作
- swift - 如何在 Swift 中处理多个泛型协议?
- pointers - big.Int 和 *big.Int 之间的区别,以及如何按值传递 big.Int
- python-3.x - 将 CSV 读取为文本文件并将其标记化
- c# - 从 API 调用响应中检索数据?
- sql - T-SQL 结果集 - 包含 3 个表