简体   繁体   English

数字作为通知Android图标

[英]Number as icon of notification Android

my problem seems be without (smart) solution... please help 我的问题似乎是没有(智能)解决方案...请帮助

I'm working on app that update a persistent notification with temp and weather description. 我正在开发可使用温度和天气描述更新持久性通知的应用程序。

The problem is that I want show current temp in notification bar but 问题是我想在通知栏中显示当前温度,但是

mNotification = new Notification.Builder(ctx)
    .setTicker(number);

this code show but with auto-hide, the only value data still persist in bar it's smallIcon. 此代码显示,但具有自动隐藏功能,唯一的值数据仍保留在栏中,它是smallIcon。

The problem is that setSmallIcon() want a resource (int) to work, this is carzy, there are other options? 问题是setSmallIcon()想要一个资源(int)起作用,这很麻烦,还有其他选择吗?

I don't want put inside app 100 or more little images with number, it's no sense... 我不想在应用程序中放入100张或更多带有数字的小图像,这是没有道理的...

Thank you 谢谢

No it is not possible according to the current android notification design principle. 不,根据当前的android通知设计原则,这是不可能的。 You are only allowed to add text in the notification area/status bar. 仅允许您在通知区域/状态栏中添加文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android 颜色通知图标 - Android Color Notification Icon 在Android设置应用程序图标时的应用程序图标上的徽章编号或在接收Facebook应用程序等通知时被杀死 - On Android setting badge number on app icon when app is in background or killed when receiving notification like facebook app Firebase 通知图标未在 Android 5.0 及更高版本上显示 - Firebase notification icon not shown on Android 5.0 and newer 如何在android studio中显示通知图标 - How to show a notification icon in android studio Android通知操作图标:找不到资源异常 - Android notification action icon: Resources not found exception Android:图标更改时未发送和显示通知 - Android : Notification not sent & shown when Icon is changed 科尔多瓦上的Android Lollipop通知图标setColor - Android Lollipop Notification Icon setColor on Cordova Android小通知图标未在5.1中显示(LOLLIPOP) - Android small notification icon not showing in 5.1 (LOLLIPOP) Android 通知图标保持默认图标,即使更改后 - Android notification Icon remains the default icon, even after change 如何通过单击按钮在应用程序图标上设置通知编号? - How to set notification number on app icon by button click?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM