Android luancher消息提醒-ShortcutBadger
16lz
2021-01-23
参考开源项目ShortcutBadger
1. Add mavenCentral to your build script.
repositories { mavenCentral() }
2. Add dependencies for ShortcutBadger, it's available from maven now.
dependencies { compile "me.leolin:ShortcutBadger:[email protected]" }
3. Add the codes below:
int badgeCount = 1; ShortcutBadger.applyCount(context, badgeCount); //for 1.1.4+ ShortcutBadger.with(getApplicationContext()).count(badgeCount); //for 1.1.3
4. If you want to remove the badge
ShortcutBadger.removeCount(context); //for 1.1.4+ ShortcutBadger.with(getApplicationContext()).remove(); //for 1.1.3
or
ShortcutBadger.applyCount(context, 0); //for 1.1.4+ ShortcutBadger.with(getApplicationContext()).count(0); //for 1.1.3
更多相关文章
- android studio导入quick cocos2dxV3.3的android项目出现的andro
- Android系列教程之四:Android项目的目录结构
- Android 调试:java 跨工程调试 android 项目
- Android Studio项目适配Android X(Android 9.0)
- 介绍本人的一个Android项目(附源代码)
- Ant 编译 Android 项目为 Apk 实战, 常见问题解决
- ADT20新建项目Android Support library not installed问题
- Android之新建项目
- Android项目打包、Eclipse视图和UI控件