NotificationManagerCompat
class NotificationManagerCompat
kotlin.Any | |
↳ | androidx.core.app.NotificationManagerCompat |
Compatibility library for NotificationManager with fallbacks for older platforms.
To use this class, call the static function from
to get a NotificationManagerCompat
object, and then call one of its methods to post or cancel notifications.
Summary
Constants | |
---|---|
static String |
Intent action to register for on a service to receive side channel notifications. |
static String |
Notification extras key: if set to true, the posted notification should use the side channel for delivery instead of using notification manager. |
static Int |
Default notification importance: shows everywhere, allowed to makes noise, but does not visually intrude. |
static Int |
Higher notification importance: shows everywhere, allowed to makes noise and peek. |
static Int |
Low notification importance: shows everywhere, but is not intrusive. |
static Int |
Highest notification importance: shows everywhere, allowed to makes noise, peek, and use full screen intents. |
static Int |
Min notification importance: only shows in the shade, below the fold. |
static Int |
A notification with no importance: shows nowhere, is blocked. |
static Int |
Value signifying that the user has not expressed an importance. |
Public methods | |
---|---|
Boolean |
Returns whether notifications from the calling package are not blocked. |
Unit |
Cancel a previously shown notification. |
Unit |
Cancel a previously shown notification. |
Unit |
Cancel all previously shown notifications. |
Unit |
createNotificationChannel(@NonNull channel: NotificationChannel) Creates a notification channel that notifications can be posted to. |
Unit |
createNotificationChannel(@NonNull channel: NotificationChannelCompat) Creates a notification channel that notifications can be posted to. |
Unit |
createNotificationChannelGroup(@NonNull group: NotificationChannelGroup) Creates a group container for |
Unit |
createNotificationChannelGroup(@NonNull group: NotificationChannelGroupCompat) Creates a group container for |
Unit |
createNotificationChannelGroups(@NonNull groups: MutableList<NotificationChannelGroup!>) Creates multiple notification channel groups. |
Unit |
createNotificationChannelGroupsCompat(@NonNull groups: MutableList<NotificationChannelGroupCompat!>) Creates multiple notification channel groups. |
Unit |
createNotificationChannels(@NonNull channels: MutableList<NotificationChannel!>) Creates multiple notification channels that different notifications can be posted to. |
Unit |
createNotificationChannelsCompat(@NonNull channels: MutableList<NotificationChannelCompat!>) Creates multiple notification channels that different notifications can be posted to. |
Unit |
deleteNotificationChannel(@NonNull channelId: String) Deletes the given notification channel. |
Unit |
deleteNotificationChannelGroup(@NonNull groupId: String) Deletes the given notification channel group, and all notification channels that belong to it. |
Unit |
deleteUnlistedNotificationChannels(@NonNull channelIds: MutableCollection<String!>) Deletes notification channels for which ids are NOT given. |
static NotificationManagerCompat |
Get a |
static MutableSet<String!> |
getEnabledListenerPackages(@NonNull context: Context) Get the set of packages that have an enabled notification listener component within them. |
Int |
Returns the user specified importance for notifications from the calling package. |
NotificationChannel? |
getNotificationChannel(@NonNull channelId: String) Returns the notification channel settings for a given channel id. |