Facebook 如何在 Android 中的应用程序图标上添加徽章编号? [英] How does Facebook add badge numbers on app icon in Android?

查看:23
本文介绍了Facebook 如何在 Android 中的应用程序图标上添加徽章编号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这里有几个问题询问是否可以将徽章添加到 Android 应用程序中,但最终都没有答案...

但不知何故,Android 的最新 Facebook 测试版

添加:

int 徽章计数 = 1;ShortcutBadger.applyCount(上下文,badgeCount);

删除:

ShortcutBadger.applyCount(context, 0);

I know there are several Qs here that ask if its possible to add badges to an android app and they all end up with a NO answer...

But somehow the latest Facebook beta version for Android seems to do something which at least look like a badge even if it is not technically exactly that.

In that post one of the commenters says that it is somehow related to TouchWiz. And also here they mention it as a feature of the "S3 TouchWiz Jelly Bean Addon".

I still would appreciate information on how does this can be done and if there is some API for this that I can use in my own app (when running in an appropriate environment - i.e. the same device where FB demonstrates this behavior) ?

解决方案

Hi you can use this lib simply.

Support : Sony,Samsung,LG,HTC,Xiaomi,ASUS,ADW,APEX,NOVA,Huawei,ZUK,OPPO

ShortcutBadger

Add :

int badgeCount = 1;
ShortcutBadger.applyCount(context, badgeCount);  

Remove :

ShortcutBadger.applyCount(context, 0);

这篇关于Facebook 如何在 Android 中的应用程序图标上添加徽章编号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆