Giter Site home page Giter Site logo

shortcutbadger's Introduction

ShortcutBadger: Maven Central

The ShortcutBadger makes your Android App show the count of unread messages as a badge on your App shortcut!

Supported launchers:

Sony


Samsung


LG


HTC


Xiaomi



ASUS


ADW


APEX


NOVA


Huawei


(Not Fully Support)

(1.1.7+)

ZUK



(1.1.10+)

OPPO


(Not Fully Support)

(1.1.10+)

EverythingMe


ZTE



(1.1.17+)

KISS



(1.1.18+)

LaunchTime


Yandex Launcher



(1.1.23+)
  • Nova launcher with TeslaUnread, Apex launcher, ADW Launcher provided by notz
  • Solid launcher provided by MajeurAndroid
  • KISS Launcher provided by alexander255

About Xiaomi devices

Xiaomi devices require extra setup with notifications, please read wiki.

IsBadgeWorking?

A tool for displaying your device, launcher & android version and testing whether ShortcutBadger works or not may be downloaded from

USAGE


1. Add mavenCentral to your build script.

    repositories {
        mavenCentral()
    }


2. Add dependencies for ShortcutBadger, it's available from maven now.

    dependencies {
        implementation "me.leolin:ShortcutBadger:1.1.22@aar"
    }


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




DEVELOP BY

Leo Lin - [email protected]

ABOUT Google Play Developer Term Violations

If you receive a message from Google containing something like this:

    REASON FOR WARNING: Violation of section 4.4 of the Developer Distribution Agreement.

please use version 1.1.0+!

CHANGE LOG

1.1.23:

  • Added Yandex Launcher support. Fixed issue with incorrect default launcher resolve

1.1.22:

1.1.20:

  • Renamed default broadcast action; added Android Oreo support.

1.1.19:

  • Fix multiple home package resolve issue.

1.1.18:

  • Add Kill Launcher Support

1.1.17:

  • Add ZTE Support

1.1.16:

  • Improve Sony Launcher support.

1.1.15:

  • Add EverythingLauncher Support.

1.1.14:

  • Fix for specific class of Samsung devices: with android 5, but without support of DefaultBadger
  • Remove Xiaomi from Badger and add Notification Support for Xiaomi devices.

1.1.13:

  • Fix XiaomiBadger (tested with RedMi Note4)

1.1.12:

  • Handling Samsung badger for old devices and new devices.
  • Try to support newer Xiaomi (Not tested.)
  • Try to support Vivo (Not tested.)

1.1.11:

  • Add OPPO Launcher Support

1.1.10:

  • Add ZUK Launcher Support

1.1.9:

  • Add SamsungBadger back for more Samsung devices support.

1.1.8:

  • Remove SolidBadger, now solid launcher will use default badger.

1.1.7:

  • Add Huawei launcher support.

1.1.6:

  • Add support for new Sony Launchers.

1.1.5:

  • applyCount will return if the Broadcast has been sent successfully.

1.1.4:

  • Changed ShortcutBadger.setBadge(context, badgeCount) to ShortcutBadger.applyCount(context, badgeCount);

1.1.3:

  • Deprecate SamsungBadger and LGBadger, those devices can use DefaultBadger.

1.1.2:

  • Add support for com.miui.mihome2

1.1.1:

  • Add DefaultBadger because some launchers use android.intent.action.BADGE_COUNT_UPDATE to update count.
  • Since the ShortcutBadgerException is helpless. So change api to set badge and never have to handle the exception again.

1.1.0:

  • Remove Android Launcher support due to Google Play Developer Term Violation since 4.4.

1.0.10:

  • Add Asus launcher support.

1.0.9:

  • Add Xiaomi launcher support.

LICENSE


    Copyright 2014 Leo Lin
    
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

shortcutbadger's People

Contributors

anderweb avatar andhie avatar auchri avatar awfurtado avatar barryvdh avatar dmitrypliskov avatar evgeniysharafan avatar githubsaturn avatar jaassoon avatar jiehuadai avatar jule- avatar kalpeshburad avatar kneep avatar leolin310148 avatar linusu avatar litingjun2015 avatar majeurandroid avatar mcloo avatar morenoh149 avatar nickpakhomov avatar nieldeokar avatar ningso avatar notz avatar ntninja avatar opayen avatar quaap avatar rsanjuan87 avatar sebokopter avatar silentnuke avatar ynntk4815 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shortcutbadger's Issues

Badge for a widget

Is it possible to set and update badge for a widget with this library?

Does not work on LG

Im trying the library on the stock LG home and its not adding the badge to the app.

The test app shows: com.lge.launcher2

Please add a license

Hello,

I'd like to use your library in a project. Could you please add a license?

Best Regards,
Jabro

Doesn't work with ProGuard

I need to add these lines to make it work.

-keep class me.leolin.shortcutbadger.impl.AdwHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.ApexHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.AsusHomeLauncher { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.DefaultBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.NewHtcHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.NovaHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.SolidHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.SonyHomeBadger { <init>(...); }
-keep class me.leolin.shortcutbadger.impl.XiaomiHomeBadger { <init>(...); }

release tags?

It would be better if there are git tag per release!

Badge not deleting on uninstall

I use the library on my project and if I uninstall the app and reinstall it the badge is still there even if i have nothing

Support TeslaUnread API

Based on thread: iNPUTmice/Conversations#314
I would like to draw your attention to the comment by @RazarF (#1).

[...] If you are using the Nova Launcher, there is an option to show the number of unread messages right in the app symbol. [...]

WDTY?
Is that something you would consider?

Does not work for LG Devices

The badger does not seem to work on LG device. I tried checking with Nova & Apex launchers but still the badge count does not show up. Do i need to do anything else to make it work..?

Nexus not working?

Hi,
I tested on HTC and Samsung both worked good.
But Nexus 5 it didn't.
Could you support Nexus series in the future?
Thanks

does not work on Samsung S4

Hello

try {
badgeCount++;
ShortcutBadger.setBadge(getApplicationContext(), badgeCount);
} catch (ShortcutBadgeException e) {
//handle the Exception
}

does not show a badge on app icon. tested on Samsung Galaxy S4. both from a service/Activity/Fragment

Callback if appbadge is rendered

Hi,

I am looking for a callback to know if the appbadge is successfully rendered on a given device? Or any other suggestion of doing the same?

Leak Memory

Hi,

when I want to removeCount, I got:

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {
.activity.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2619)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4929)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:798)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException
at me.leolin.shortcutbadger.ShortcutBadger.initBadger(ShortcutBadger.java:92)
at me.leolin.shortcutbadger.ShortcutBadger.applyCountOrThrow(ShortcutBadger.java:65)
at me.leolin.shortcutbadger.ShortcutBadger.applyCount(ShortcutBadger.java:50)
at me.leolin.shortcutbadger.ShortcutBadger.removeCount(ShortcutBadger.java:80)
at activity.BaseActivity.onResume(BaseActivity.java:95)
at activity.MainActivity.onResume(MainActivity.java:114)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1187)
at android.app.Activity.performResume(Activity.java:5328)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4929)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:798)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:565)
at dalvik.system.NativeStart.main(NativeStart.java)

Xiaomi based devices with custom launchers will not work

If a xiaomi based device has for example Nova launcher as default launcher, NovaBadger will not be set because of this piece of code :

if (Build.MANUFACTURER.equalsIgnoreCase("Xiaomi")) {
    sShortcutBadger = new XiaomiHomeBadger();
    return;
}

Why make an exeption for xiaomi devices, why not let ShortcutBadger class check if current launcher package name matchs ones provided by XiaomiBadger ?

Google Play Developer Term Violation

After i included your library to in my app and uploaded it to google play i got an email from google because of "Google Play Developer Term Violation".

it would be good if you would give any information somewhere that your library
could result into an term violation. or what to do to prevent this.

REASON FOR WARNING: Violation of section 4.4 of the Developer Distribution Agreement.

Your app has been determined to modify its own icon by exploiting an issue present in prior versions of the Android OS. This unauthorized access of the Android platform is in violation of the policy provision above. To ensure policy compliance, you will need to update your app to request both the INSTALL_SHORTCUT and UNINSTALL_SHORTCUT permissions in order to modify, add or remove app shortcuts.

Your app will be removed from the Google Play Store if you do not make modifications to bring it into compliance within 14 days of the issuance of this notification. If you have additional apps in your catalog, please also review them for compliance. Note that any remaining apps found to be in violation will be removed from the Google Play Store.

Please also consult Policy and Best Practices and the Developer Distribution Agreement as you bring your apps into compliance.

All violations are tracked. Serious or repeated violations of any nature will result in the termination of your developer account, and investigation and possible termination of related Google accounts. If your account is terminated, payments will cease and Google may recover the proceeds of any past sales and/or the cost of any associated fees (such as chargebacks and transaction fees) from you.

The Google Play Team

Using this library will ban your app from the Play Store

This app should check if the permissions INSTALL_SHORTCUT and UNINSTALL_SHORTCUT are requested in the manifest and fail if this is not the case. Otherwise the app using this library will be banned from the Play Store for not complying to section 4.4 of the developer agreement:

4.4 Prohibited Actions. You agree that you will not engage in any activity with the Store, including the development or distribution of Products, that interferes with, disrupts, damages, or accesses in an unauthorized manner the devices, servers, networks, or other properties or services of any third party including, but not limited to, Android users, Google or any mobile network operator. You may not use customer information obtained from the Store to sell or distribute Products outside of the Store.

After being banned twice, I received the following explanation from Google:

REASON FOR WARNING: Violation of section 4.4 of the Developer Distribution Agreement.
Your app has been determined to modify its own icon by exploiting an issue present in prior versions of the Android OS. This unauthorized access of the Android platform is in violation of the policy provision above. To ensure policy compliance, you will need to update your app to request both the INSTALL_SHORTCUT and UNINSTALL_SHORTCUT permissions in order to modify, add or remove app shortcuts.

The documentation should make clear that these permissions are required.

Ideally, it should not use an exploit at all.

ShortcutBadgerException has something to say...

Here is the ShortcutBadgerException message :

Unable to execute badge:Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it.

My icon badge is always 1, and impossible to remove even with setBadge(context, 0) !

I'm on a Samsung Galaxy S3 with Android 4.3 and I set the badge with :

try {
ShortcutBadger.setBadge(getApplicationContext(), Integer.parseInt(12);
}
catch (Exception e) {}

NPE on ShortcutBadger.initBadger

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ComponentName android.content.Intent.getComponent()' on a null object reference
at me.leolin.shortcutbadger.ShortcutBadger.initBadger(ShortcutBadger.java:92)
at me.leolin.shortcutbadger.ShortcutBadger.applyCountOrThrow(ShortcutBadger.java:65)
at me.leolin.shortcutbadger.ShortcutBadger.applyCount(ShortcutBadger.java:50)

on HUAWEI HUAWEI GRA-L09 Android 5.0.1

Needs to add these permissions in xml. Should put this in the readme file

<!--for android badge-->
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS"/>

<!--for Samsung badge-->
<uses-permission android:name="com.sec.android.provider.badge.permission.READ"/>
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>

<!--for htc badge-->
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT"/>

<!--for sony badge-->
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>

<!--for apex badge-->
<uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT"/>

didn't show badge count after version 1.0.10

shortcutBadger version 1.0.10 works
but after version 1.0.10 didn't work, didn't show up badge count.

after version 1.1.0 , u notify that change using DefaultBadger
Remove Android Launcher support due to Google Play Developer Term Violation since 4.4 .

Xiomi 4 shows only 1 badge count

Hi leolin,

Whenever we increment badge count it does't increment badges. It shows only 1 as badge count.
We also debug it. Our counter incremented properly and also we set it , but it is not working. It always show 1 as badge count.

What should we do?

Phone Configurations are: Mi 4
Android Version : 5.0.2 LRX22G

Not Working with "com.android.launcher"

Hello,

I am using this project on the Micromax Canvas & Nexus devices. But this is not working on those device which have "com.android.launcher".

Please tell me what is the problem? I am waiting for your response.

Thanks,
Vivek Kumar

Cannot set number over 99

When number 99 and increse number badge to 100 or over 100
It throws exception can't set.
P.s. I test on Samsung device {OS: 4.1.2, 4.3, 4.4}

S6 Edge latest OS version causing a SQL crash

Hi,

We have been using your ShortcutBadge for a couple of months but have noticed that since the last OS update 5.1.1 - Build - LMY47X.G92FXXU2BOGB on the S6 Edge the badge stopped working and the following crash is occurring every time we attempt to update the badge,

E/DatabaseUtils﹕ Writing exception to parcel
android.database.sqlite.SQLiteException: no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?)
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: id (code 1): , while compiling: SELECT id, class FROM apps WHERE (package=?))
#################################################################
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1093)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:670)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:59)
at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:37)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1454)
at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:400)
at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:294)
at com.sec.android.provider.badge.BadgeProvider.query(BadgeProvider.java:153)
at android.content.ContentProvider.query(ContentProvider.java:1007)
at android.content.ContentProvider$Transport.query(ContentProvider.java:218)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
at android.os.Binder.execTransact(Binder.java:461)
07-30 15:09:54.133 23203-25032/com.
.
E/ShortcutBadger﹕ no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?)
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?))
#################################################################
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?)
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?))
#################################################################)
#################################################################
android.database.sqlite.SQLiteException: no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?)
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?))
#################################################################
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?)
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(no such column: _id (code 1): , while compiling: SELECT _id, class FROM apps WHERE (package=?))
#################################################################)
#################################################################
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:181)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
at android.content.ContentResolver.query(ContentResolver.java:489)
at android.content.ContentResolver.query(ContentResolver.java:433)
at me.leolin.shortcutbadger.impl.SamsungHomeBadger.executeBadge(SamsungHomeBadger.java:32)
at me.leolin.shortcutbadger.ShortcutBadger.count(ShortcutBadger.java:118)

Thanks you for the cool lib, we would like to continue using it.

Not working on 5.1.1

Hi,

I am using ShortcutBadger 1.1.4. On my test phone (samung galaxy s4 5.0.1) it is working. On my main phone (Samsung galaxy s6 edge plus 5.1.1) it does not display the count. I am using ShortcutBadger.applyCount(context, totalInboxUnreadCount); am I missing anything?

Thanks,

MH

Add support for com.google.android.googlequicksearchbox

Seems like com.google.android.googlequicksearchbox is not supported.

I got the message below when using

try {
     ShortcutBadger.setBadge(context, (int) unreadCount);
} catch (final ShortcutBadgeException badgeExc) {
     Log.w(LOG_TAG, "failed to set unreadCount badge" + badgeExc);
}

in a Nexus 5 with Android 4.4.4
11-21 12:48:31.332: W/AlarmReceiver(5974): failed to set unreadCount badgeme.leolin.shortcutbadger.ShortcutBadgeException: ShortcutBadger is currently not support the home launcher package "com.google.android.googlequicksearchbox"

 

Adding support for this would be nice

Not work on android emulator api 22 and api 23.

I use this for my project, and test it work fine on LG & Sony z1 phone. However, when I test it on emulator Marshmallow 6.0 (api 23) and 5.0 (api 22), Nexus 7 android 4(API 19) all the results is failed.

DefaultBadger not reliable on Samsung S4 (5.0.1)

Using the recommended approach, I was able to set the badge icon for my app -- but only once. All future calls produced no effect and no exception. In my case, I initially set it to 10, and could not change it.

Using your suggested code, the query showed that indeed the later calls did not affect the badge count (remained at 10, despite my calls to ShortcutBadger).

However, if I manually instantiated your @Deprecated SamsungHomeBadger, and executed it, the badge did update as expected -- which is my current workaround.

Embedding in another aar

I'm trying to embed ShortcutBadger inside our AAR, however gradle is not able to bundle other's aars into out project, and this requires our clients to add ShortcutBadger to their own apps when using our AAR.
I've included ShortcutBadgers manifest items in our manifest, is there any way I can find a ShortcutBadger.jar file and include it in our AAR?

Or any body knows another way of solving this?

Not working on Nexus 5 device with android 6

Hi, im adding this library to my app but seems its not working for Marshmallow, any idea what can be the issue here?

Here is the code i use:
ShortcutBadger.with(mContext).count(sum);
and in gradle:
compile 'me.leolin:ShortcutBadger:1.1.3@aar'

xiaomi not working?

Hi,
I test on LG it worked good.
But xiaomi it didn't. I use xiaomi 2.
Thanks

Nexus 7 SecurityException

I implemented the ShortcutBadger within my project and it is running perfectly on my Samsung Note 2 and Samsung Tab 4. I am running into an issue when running my code on a Google Nexus 7. I get the following:

FATAL EXCEPTION: main
java.lang.SecurityException: Permission Denial: writing com.android.launcher2.LauncherProvider uri content://com.android.launcher2.settings/favorites?notify=true from pid=4933, uid=10127 requires com.android.launcher.permission.WRITE_SETTINGS, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1465)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at android.content.ContentProviderProxy.update(ContentProviderNative.java:560)
at android.content.ContentResolver.update(ContentResolver.java:1316)
at com.shortcutBadger.impl.AndroidHomeBadger.executeBadge(AndroidHomeBadger.java:37)
at com.shortcutBadger.ShortcutBadger.setBadge(ShortcutBadger.java:74)

I have the following in my Manifest File:

<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
<uses-permission android:name="com.htc.launcher.permission.WRITE_SETTINGS" />
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />

I have the correct permission, but something is still not happy. Any idea what could be causing this exception?

Seek advice

what's the main idea to write a child class extends shortcutbadger like CoolpadHomeBadger? I got the launcher, but do not understand the main idea to write the CoolpadHomeBadger. I'm very longing for you to help. Thanks.

Not working on Xiaomi Redmi Note III

Hello,
just to report in that the program does not work - the badge is not displayed in the source code.

I have the phone here tho: if you need help debugging, please email me at tamhan aht tamoggemon roundthing com.

Tam

Crash on android preview L emulator

Hi

Tried it on preview (L) emulator. Got this.

java.lang.SecurityException: Permission Denial: writing com.android.launcher2.LauncherProvider uri content://com.android.launcher2.settings/favorites?notify=true from pid=3128, uid=10056 requires com.android.launcher.permission.WRITE_SETTINGS, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1489)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at android.content.ContentProviderProxy.update(ContentProviderNative.java:567)
at android.content.ContentResolver.update(ContentResolver.java:1321)
at com.shortcutBadger.impl.AndroidHomeBadger.executeBadge(AndroidHomeBadger.java:37)
at com.shortcutBadger.ShortcutBadger.setBadge(ShortcutBadger.java:74)

Not Working With Samsung

try {
ShortcutBadger.setBadge(getApplication(), badge);
} catch (ShortcutBadgeException e) {
//handle the Exception
}

iam doing this Exactly but its not Working ??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.