关闭

Is there a way to add a badge to an application icon in Android?

标签: applicationbadgeblackberryandroidiphoneimage
566人阅读 评论(0) 收藏 举报

问:

On the iPhone, you can add a numbered badge to the application icon. On BlackBerry, I've successfully painted an image onto the application's icon while in the program. I want to do this for Android as well. I don't want to use the notification bar, as it's not something that needs to be notified instantly. Instead, I just want the user to be able to see how many new messages are in the application just by looking at the application icon.

Thanks in advance,

groomsy



答:

Unfortunately, Android does not allow changing of the application icon because it's sealed in the APK once the program is compiled. There is no way to programmatically change it to a 'drawable'.

You may achieve your goal by using a widget instead of an icon. Widgets are highly customisable and can do what you want.

There's a short discussion about the difference between iPhone icon notification and using widgets here:

http://www.cnet.com/8301-19736_1-10278814-251.html

As you'll notice, there is virtually no difference between using a widget or an icon, since they can be the same size and look the same.



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:984061次
    • 积分:11560
    • 等级:
    • 排名:第1328名
    • 原创:49篇
    • 转载:1058篇
    • 译文:1篇
    • 评论:17条
    最新评论