android - 将文本显示为通知图标
问题描述
我正在尝试向将计数器显示为图标而不是实际图标的用户显示通知。
这就是我想要实现的目标
到目前为止我尝试过的
int myCounter = 0;
setSmallIcon(myCounter); // actually the notification won't even display if its not an actual icon
setTickerText(String.valueOf(myCounter)); // This is actualy something different
setLargeIcon(myBitmapWithText); // I also tried generating a bitmap with text, but it won't display since the resource needs to be in the app-package itself
根据我的阅读,我可以使用一个AnimatedDrawable
但它真的不合逻辑来创建 50 个不同的可绘制对象来完成该任务,除非我没有其他选择:)
我对此一无所知,我怎样才能达到上述结果?
解决方案
推荐阅读
- regex - IC 号码验证所需的正则表达式
- angular - 如何在 Angular 7 中向 CKEditor 的工具栏添加按钮?
- mosquitto - 在 mosquitto 桥中重新映射 MQTT 主题?
- r - 在 docx 标题中的图像上覆盖文本 - rmarkdown
- python - 如何使一个字典中的值成为 python 中新字典的键?
- javascript - 错误:“评论”被分配了一个值但从未使用过 - Javascript
- maven - Artifactory + TeamCity:如何部署自定义 JAR?
- javascript - 如何在删除时从数组中删除索引
- php - Laravel 5.4:如何验证具有相同名称的文件输入数组?
- javascript - 如何触发 MediaError