-
public final class ShortcutBadger
-
-
Method Summary
Modifier and Type Method Description static booleanapplyCount(Context context, int badgeCount)Tries to update the notification count static voidapplyCountOrThrow(Context context, int badgeCount)Tries to update the notification count, throw a ShortcutBadgeException if it fails static booleanremoveCount(Context context)Tries to remove the notification count static voidremoveCountOrThrow(Context context)Tries to remove the notification count, throw a ShortcutBadgeException if it fails static booleanisBadgeCounterSupported(Context context)Whether this platform launcher supports shortcut badges. static voidapplyNotification(Context context, Notification notification, int badgeCount)-
-
Method Detail
-
applyCount
static boolean applyCount(Context context, int badgeCount)
Tries to update the notification count
- Parameters:
context- Caller contextbadgeCount- Desired badge count
-
applyCountOrThrow
static void applyCountOrThrow(Context context, int badgeCount)
Tries to update the notification count, throw a ShortcutBadgeException if it fails
- Parameters:
context- Caller contextbadgeCount- Desired badge count
-
removeCount
static boolean removeCount(Context context)
Tries to remove the notification count
- Parameters:
context- Caller context
-
removeCountOrThrow
static void removeCountOrThrow(Context context)
Tries to remove the notification count, throw a ShortcutBadgeException if it fails
- Parameters:
context- Caller context
-
isBadgeCounterSupported
static boolean isBadgeCounterSupported(Context context)
Whether this platform launcher supports shortcut badges. Doing this check causes the sideeffect of resetting the counter if it's supported, so this method should be followed bya call that actually sets the counter to the desired value, if the counter is supported.
-
applyNotification
static void applyNotification(Context context, Notification notification, int badgeCount)
- Parameters:
context- Caller context
-
-
-
-