leolin310148 / ShortcutBadger

An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers.
Other
7.35k stars 1.34k forks source link

No field extraNotification #335

Open uzafar opened 5 years ago

uzafar commented 5 years ago

We are using this library in our app but receiving the following exception:

me.leolin.shortcutbadger.ShortcutBadgeException: No field extraNotification in class Landroid/app/Notification; (declaration of 'android.app.Notification' appears in /system/framework/framework.jar)

This is happening in following piece of code, can you provide any workaround for this? thanks

Field field = notification.getClass().getDeclaredField("extraNotification"); Object extraNotification = field.get(notification); Method method = extraNotification.getClass().getDeclaredMethod("setMessageCount", int.class); method.invoke(extraNotification, badgeCount);