public final class ShortcutBadger
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
applyCount(android.content.Context context,
int badgeCount)
Tries to update the notification count
|
static void |
applyCountOrThrow(android.content.Context context,
int badgeCount)
Tries to update the notification count, throw a
ShortcutBadgeException if it fails |
static void |
applyNotification(android.content.Context context,
android.app.Notification notification,
int badgeCount) |
static boolean |
isBadgeCounterSupported(android.content.Context context)
Whether this platform launcher supports shortcut badges.
|
static boolean |
removeCount(android.content.Context context)
Tries to remove the notification count
|
static void |
removeCountOrThrow(android.content.Context context)
Tries to remove the notification count, throw a
ShortcutBadgeException if it fails |
public static boolean applyCount(android.content.Context context,
int badgeCount)
context - Caller contextbadgeCount - Desired badge countpublic static void applyCountOrThrow(android.content.Context context,
int badgeCount)
throws ShortcutBadgeException
ShortcutBadgeException if it failscontext - Caller contextbadgeCount - Desired badge countShortcutBadgeExceptionpublic static boolean removeCount(android.content.Context context)
context - Caller contextpublic static void removeCountOrThrow(android.content.Context context)
throws ShortcutBadgeException
ShortcutBadgeException if it failscontext - Caller contextShortcutBadgeExceptionpublic static boolean isBadgeCounterSupported(android.content.Context context)
public static void applyNotification(android.content.Context context,
android.app.Notification notification,
int badgeCount)
context - Caller contextnotification - badgeCount -