# NotificationManagerCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/NotificationManagerCompat.java+class:androidx.core.app.NotificationManagerCompat) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public final class NotificationManagerCompat
```

<br />

*** ** * ** ***

Compatibility library for NotificationManager with fallbacks for older platforms.

To use this class, call the static function `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#from(android.content.Context)` to get a `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat` object, and then call one of its methods to post or cancel notifications.

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat.NotificationWithIdAndTag` Helper class which encapsulates a Notification, its id, and optionally a tag, for use when batch-posting a number of notifications. |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#ACTION_BIND_SIDE_CHANNEL() = "android.support.BIND_NOTIFICATION_SIDE_CHANNEL"` Intent action to register for on a service to receive side channel notifications. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#EXTRA_USE_SIDE_CHANNEL() = "android.support.useSideChannel"` Notification extras key: if set to true, the posted notification should use the side channel for delivery instead of using notification manager. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_DEFAULT() = 3` Default notification importance: shows everywhere, allowed to makes noise, but does not visually intrude. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_HIGH() = 4` Higher notification importance: shows everywhere, allowed to makes noise and peek. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_LOW() = 2` Low notification importance: shows everywhere, but is not intrusive. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_MAX() = 5` Highest notification importance: shows everywhere, allowed to makes noise, peek, and use full screen intents. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_MIN() = 1` Min notification importance: only shows in the shade, below the fold. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_NONE() = 0` A notification with no importance: shows nowhere, is blocked. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_UNSPECIFIED() = -1000` Value signifying that the user has not expressed an importance. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#INTERRUPTION_FILTER_ALARMS() = 4` `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - Alarms only interruption filter - all notifications except those of category `https://developer.android.com/reference/android/app/Notification.html#CATEGORY_ALARM` are suppressed. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#INTERRUPTION_FILTER_ALL() = 1` `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - Normal interruption filter - no notifications are suppressed. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#INTERRUPTION_FILTER_NONE() = 3` `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - No interruptions filter - all notifications are suppressed and all audio streams (except those used for phone calls) and vibrations are muted. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#INTERRUPTION_FILTER_PRIORITY() = 2` `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - Priority interruption filter - all notifications are suppressed except those that match the priority criteria. |
| `static final int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#INTERRUPTION_FILTER_UNKNOWN() = 0` `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - returned when the value is unavailable for any reason. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#areNotificationsEnabled()()` Returns whether notifications from the calling package are not blocked. |
| `boolean` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#canPostPromotedNotifications()()` Returns whether the calling app's properly formatted notifications can appear in a promoted format, which may result in higher ranking, appearances on additional surfaces, and richer presentation. |
| `boolean` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#canUseFullScreenIntent()()` Returns whether the calling app can send fullscreen intents. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#cancel(int)(int id)` Cancel a previously shown notification. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#cancel(java.lang.String,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html tag, int id)` Cancel a previously shown notification. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#cancelAll()()` Cancel all previously shown notifications. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannel(android.app.NotificationChannel)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/NotificationChannel.html channel)` Creates a notification channel that notifications can be posted to. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannel(androidx.core.app.NotificationChannelCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat channel)` Creates a notification channel that notifications can be posted to. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroup(android.app.NotificationChannelGroup)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/NotificationChannelGroup.html group)` Creates a group container for `https://developer.android.com/reference/android/app/NotificationChannel.html` objects. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationChannelGroupCompat group )` Creates a group container for `https://developer.android.com/reference/android/app/NotificationChannel.html` objects. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroups(java.util.List<android.app.NotificationChannelGroup>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/app/NotificationChannelGroup.html> groups )` Creates multiple notification channel groups. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroupsCompat(java.util.List<androidx.core.app.NotificationChannelGroupCompat>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationChannelGroupCompat> groups )` Creates multiple notification channel groups. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannels(java.util.List<android.app.NotificationChannel>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/app/NotificationChannel.html> channels)` Creates multiple notification channels that different notifications can be posted to. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelsCompat(java.util.List<androidx.core.app.NotificationChannelCompat>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat> channels )` Creates multiple notification channels that different notifications can be posted to. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#deleteNotificationChannel(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelId)` Deletes the given notification channel. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#deleteNotificationChannelGroup(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html groupId)` Deletes the given notification channel group, and all notification channels that belong to it. |
| `void` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#deleteUnlistedNotificationChannels(java.util.Collection<java.lang.String>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> channelIds )` Deletes notification channels for which ids are NOT given. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#from(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Get a `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat` instance for a provided context. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/service/notification/StatusBarNotification.html>` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getActiveNotifications()()` Recover a list of active notifications: ones that have been posted by the calling app that have not yet been dismissed by the user or `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#cancel(java.lang.String,int)`ed by the app. |
| `int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()()` Gets the current notification interruption filter. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getEnabledListenerPackages(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` Get the set of packages that have an enabled notification listener component within them. |
| `int` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getImportance()()` Returns the user specified importance for notifications from the calling package. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/NotificationChannel.html` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannel(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelId)` Returns the notification channel settings for a given channel id. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/NotificationChannel.html` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannel(java.lang.String,java.lang.String)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelId, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html conversationId )` Returns the notification channel settings for a given channel and `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getId()`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelCompat(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelId)` Returns the notification channel settings for a given channel id. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelCompat(java.lang.String,java.lang.String)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelId, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html conversationId )` Returns the notification channel settings for a given channel and `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getId()`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/NotificationChannelGroup.html` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelGroup(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelGroupId)` Returns the notification channel group settings for a given channel group id. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/app/NotificationChannelGroupCompat` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelGroupCompat(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html channelGroupId)` Returns the notification channel group settings for a given channel group id. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/app/NotificationChannelGroup.html>` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelGroups()()` Returns all notification channel groups belonging to the calling app or an empty list on older SDKs which don't support Notification Channels. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationChannelGroupCompat>` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelGroupsCompat()()` Returns all notification channel groups belonging to the calling app or an empty list on older SDKs which don't support Notification Channels. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/app/NotificationChannel.html>` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannels()()` Returns all notification channels belonging to the calling app or an empty list on older SDKs which don't support Notification Channels. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat>` | `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getNotificationChannelsCompat()()` Returns all notification channels belonging to the calling app or an empty list on older SDKs which don't support Notification Channels. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS) https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#notify(java.util.List<androidx.core.app.NotificationManagerCompat.NotificationWithIdAndTag>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat.NotificationWithIdAndTag> notificationWithIdAndTags )` Post a number of notifications, to be shown in the status bar, stream, etc. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS) https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#notify(int,android.app.Notification)(int id, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Notification.html notification)` Post a notification to be shown in the status bar, stream, etc. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS) https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#notify(java.lang.String,int,android.app.Notification)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html tag, int id, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Notification.html notification)` Post a notification to be shown in the status bar, stream, etc. |

## Constants

### ACTION_BIND_SIDE_CHANNEL

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final String ACTION_BIND_SIDE_CHANNEL = "android.support.BIND_NOTIFICATION_SIDE_CHANNEL"
```

Intent action to register for on a service to receive side channel notifications. The listening service must be in the same package as an enabled `https://developer.android.com/reference/android/service/notification/NotificationListenerService.html`.

### EXTRA_USE_SIDE_CHANNEL

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final String EXTRA_USE_SIDE_CHANNEL = "android.support.useSideChannel"
```

Notification extras key: if set to true, the posted notification should use the side channel for delivery instead of using notification manager.

### IMPORTANCE_DEFAULT

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_DEFAULT = 3
```

Default notification importance: shows everywhere, allowed to makes noise, but does not visually intrude.

### IMPORTANCE_HIGH

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_HIGH = 4
```

Higher notification importance: shows everywhere, allowed to makes noise and peek.

### IMPORTANCE_LOW

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_LOW = 2
```

Low notification importance: shows everywhere, but is not intrusive.

### IMPORTANCE_MAX

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_MAX = 5
```

Highest notification importance: shows everywhere, allowed to makes noise, peek, and use full screen intents.

### IMPORTANCE_MIN

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_MIN = 1
```

Min notification importance: only shows in the shade, below the fold.

### IMPORTANCE_NONE

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_NONE = 0
```

A notification with no importance: shows nowhere, is blocked.

### IMPORTANCE_UNSPECIFIED

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final int IMPORTANCE_UNSPECIFIED = -1000
```

Value signifying that the user has not expressed an importance. This value is for persisting preferences, and should never be associated with an actual notification.

### INTERRUPTION_FILTER_ALARMS

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public static final int INTERRUPTION_FILTER_ALARMS = 4
```

`https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - Alarms only interruption filter - all notifications except those of category `https://developer.android.com/reference/android/app/Notification.html#CATEGORY_ALARM` are suppressed. Some audio streams are muted.

### INTERRUPTION_FILTER_ALL

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public static final int INTERRUPTION_FILTER_ALL = 1
```

`https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - Normal interruption filter - no notifications are suppressed.

### INTERRUPTION_FILTER_NONE

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public static final int INTERRUPTION_FILTER_NONE = 3
```

`https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - No interruptions filter - all notifications are suppressed and all audio streams (except those used for phone calls) and vibrations are muted.

### INTERRUPTION_FILTER_PRIORITY

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public static final int INTERRUPTION_FILTER_PRIORITY = 2
```

`https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - Priority interruption filter - all notifications are suppressed except those that match the priority criteria. Some audio streams are muted. See priorityCallSenders, priorityCategories, priorityMessageSenders to define or query this criteria. Users can additionally specify packages that can bypass this interruption filter.

### INTERRUPTION_FILTER_UNKNOWN

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public static final int INTERRUPTION_FILTER_UNKNOWN = 0
```

`https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#getCurrentInterruptionFilter()` constant - returned when the value is unavailable for any reason.

## Public methods

### areNotificationsEnabled

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public boolean areNotificationsEnabled()
```

Returns whether notifications from the calling package are not blocked.

### canPostPromotedNotifications

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/core#1.17.0)

```
public boolean canPostPromotedNotifications()
```

Returns whether the calling app's properly formatted notifications can appear in a promoted format, which may result in higher ranking, appearances on additional surfaces, and richer presentation. Apps can request this permission by sending the user to the activity that matches the system intent action `https://developer.android.com/reference/android/provider/Settings.html#ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS`.

### canUseFullScreenIntent

Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/core#1.12.0)

```
public boolean canUseFullScreenIntent()
```

Returns whether the calling app can send fullscreen intents.

Fullscreen intents were introduced in Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#HONEYCOMB`, where apps could always attach a full screen intent to their notification via `https://developer.android.com/reference/android/app/Notification.Builder.html#setFullScreenIntent(android.app.PendingIntent, boolean)`}.

Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#Q` introduced the `https://developer.android.com/reference/android/Manifest.permission.html#USE_FULL_SCREEN_INTENT` permission, where SystemUI will only show the full screen intent attached to a notification if the permission is declared in the manifest.

Starting from Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#UPSIDE_DOWN_CAKE`, apps may not have permission to use `https://developer.android.com/reference/android/Manifest.permission.html#USE_FULL_SCREEN_INTENT`. If the FSI permission is denied, SystemUI will show the notification as an expanded heads up notification on lockscreen.

To request access, add the `https://developer.android.com/reference/android/Manifest.permission.html#USE_FULL_SCREEN_INTENT` permission to your manifest, and use `https://developer.android.com/reference/android/provider/Settings.html#ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT` to send the user to the settings page where they can grant your app the FSI permission.

### cancel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void cancel(int id)
```

Cancel a previously shown notification.

| Parameters |
|---|---|
| `int id` | the ID of the notification |

### cancel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void cancel(@Nullable String tag, int id)
```

Cancel a previously shown notification.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html tag` | the string identifier of the notification. |
| `int id` | the ID of the notification |

### cancelAll

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void cancelAll()
```

Cancel all previously shown notifications.

### createNotificationChannel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void createNotificationChannel(@NonNull NotificationChannel channel)
```

Creates a notification channel that notifications can be posted to. This can also be used to restore a deleted channel and to update an existing channel's name, description, group, and/or importance.

The importance of an existing channel will only be changed if the new importance is lower than the current value and the user has not altered any settings on this channel.

The group of an existing channel will only be changed if the channel does not already belong to a group. All other fields are ignored for channels that already exist. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/NotificationChannel.html channel` | the channel to create. Note that the created channel may differ from this value. If the provided channel is malformed, a RemoteException will be thrown. |

### createNotificationChannel

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public void createNotificationChannel(@NonNull NotificationChannelCompat channel)
```

Creates a notification channel that notifications can be posted to. This can also be used to restore a deleted channel and to update an existing channel's name, description, group, and/or importance.

The importance of an existing channel will only be changed if the new importance is lower than the current value and the user has not altered any settings on this channel.

The group of an existing channel will only be changed if the channel does not already belong to a group. All other fields are ignored for channels that already exist. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat channel` | the channel to create. Note that the created channel may differ from this value. If the provided channel is malformed, a RemoteException will be thrown. |

### createNotificationChannelGroup

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void createNotificationChannelGroup(@NonNull NotificationChannelGroup group)
```

Creates a group container for `https://developer.android.com/reference/android/app/NotificationChannel.html` objects. This can be used to rename an existing group. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/NotificationChannelGroup.html group` | The group to create |

### createNotificationChannelGroup

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public void createNotificationChannelGroup(
    @NonNull NotificationChannelGroupCompat group
)
```

Creates a group container for `https://developer.android.com/reference/android/app/NotificationChannel.html` objects. This can be used to rename an existing group. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/app/NotificationChannelGroupCompat group` | The group to create |

### createNotificationChannelGroups

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void createNotificationChannelGroups(
    @NonNull List<NotificationChannelGroup> groups
)
```

Creates multiple notification channel groups. See `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroup(android.app.NotificationChannelGroup)`. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/app/NotificationChannelGroup.html> groups` | The list of groups to create |

### createNotificationChannelGroupsCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public void createNotificationChannelGroupsCompat(
    @NonNull List<NotificationChannelGroupCompat> groups
)
```

Creates multiple notification channel groups. See `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannelGroup(androidx.core.app.NotificationChannelGroupCompat)`. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationChannelGroupCompat> groups` | The list of groups to create |

### createNotificationChannels

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void createNotificationChannels(@NonNull List<NotificationChannel> channels)
```

Creates multiple notification channels that different notifications can be posted to. See `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannel(android.app.NotificationChannel)`. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/app/NotificationChannel.html> channels` | the list of channels to attempt to create. |

### createNotificationChannelsCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public void createNotificationChannelsCompat(
    @NonNull List<NotificationChannelCompat> channels
)
```

Creates multiple notification channels that different notifications can be posted to. See `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannel(androidx.core.app.NotificationChannelCompat)`. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/core/app/NotificationChannelCompat> channels` | the list of channels to attempt to create. |

### deleteNotificationChannel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void deleteNotificationChannel(@NonNull String channelId)
```

Deletes the given notification channel.

If you `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#createNotificationChannel(android.app.NotificationChannel)` a new channel with this same id, the deleted channel will be un-deleted with all of the same settings it had before it was deleted. It doesn't do anything on older SDKs which don't support Notification Channels.

### deleteNotificationChannelGroup

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public void deleteNotificationChannelGroup(@NonNull String groupId)
```

Deletes the given notification channel group, and all notification channels that belong to it. It doesn't do anything on older SDKs which don't support Notification Channels.

### deleteUnlistedNotificationChannels

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public void deleteUnlistedNotificationChannels(
    @NonNull Collection<String> channelIds
)
```

Deletes notification channels for which ids are NOT given. This will NOT delete channels which are conversation children of the given channels. It doesn't do anything on older SDKs which don't support Notification Channels.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Collection.html<https://developer.android.com/reference/java/lang/String.html> channelIds` | the IDs of any channels which should NOT be deleted by this method. |

### from

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @NonNull NotificationManagerCompat from(@NonNull Context context)
```

Get a `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat` instance for a provided context.

### getActiveNotifications

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public @NonNull List<StatusBarNotification> getActiveNotifications()
```

Recover a list of active notifications: ones that have been posted by the calling app that have not yet been dismissed by the user or `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#cancel(java.lang.String,int)`ed by the app.

StatusBarNotification object, including the original and supplied to (via and ) as well as a copy of the original object (via ).

From `https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#Q`, will also return notifications you've posted as an app's notification delegate via `https://developer.android.com/reference/android/app/NotificationManager.html#notifyAsPackage(java.lang.String, java.lang.String, int, android.app.Notification)`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/service/notification/StatusBarNotification.html>` | A list of `https://developer.android.com/reference/android/service/notification/StatusBarNotification.html`. |

### getCurrentInterruptionFilter

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
public int getCurrentInterruptionFilter()
```

Gets the current notification interruption filter.

The interruption filter defines which notifications are allowed to interrupt the user (e.g. via sound \&vibration) and is applied globally.

### getEnabledListenerPackages

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @NonNull Set<String> getEnabledListenerPackages(@NonNull Context context)
```

Get the set of packages that have an enabled notification listener component within them.

### getImportance

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public int getImportance()
```

Returns the user specified importance for notifications from the calling package.

| Returns |
|---|---|
| `int` | An importance level, such as `https://developer.android.com/reference/androidx/core/app/NotificationManagerCompat#IMPORTANCE_DEFAULT()`. |

### getNotificationChannel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable NotificationChannel getNotificationChannel(@NonNull String channelId)
```

Returns the notification channel settings for a given channel id. Returns `null` on older SDKs which don't support Notification Channels.

### getNotificationChannel

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @Nullable NotificationChannel getNotificationChannel(
    @NonNull String channelId,
    @NonNull String conversationId
)
```

Returns the notification channel settings for a given channel and `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getId()`. Returns the channel for the channelId on older SDKs which don't support Conversations. Returns `null` on older SDKs which don't support Notification Channels.

### getNotificationChannelCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @Nullable NotificationChannelCompat getNotificationChannelCompat(@NonNull String channelId)
```

Returns the notification channel settings for a given channel id. Returns `null` on older SDKs which don't support Notification Channels.

### getNotificationChannelCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @Nullable NotificationChannelCompat getNotificationChannelCompat(
    @NonNull String channelId,
    @NonNull String conversationId
)
```

Returns the notification channel settings for a given channel and `https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#getId()`. Returns the channel for the channelId on older SDKs which don't support Conversations. Returns `null` on older SDKs which don't support Notification Channels.

### getNotificationChannelGroup

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @Nullable NotificationChannelGroup getNotificationChannelGroup(@NonNull String channelGroupId)
```

Returns the notification channel group settings for a given channel group id. Returns `null` on older SDKs which don't support Notification Channels.

### getNotificationChannelGroupCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @Nullable NotificationChannelGroupCompat getNotificationChannelGroupCompat(@NonNull String channelGroupId)
```

Returns the notification channel group settings for a given channel group id. Returns `null` on older SDKs which don't support Notification Channels.

### getNotificationChannelGroups

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @NonNull List<NotificationChannelGroup> getNotificationChannelGroups()
```

Returns all notification channel groups belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.

### getNotificationChannelGroupsCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull List<NotificationChannelGroupCompat> getNotificationChannelGroupsCompat()
```

Returns all notification channel groups belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.

### getNotificationChannels

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public @NonNull List<NotificationChannel> getNotificationChannels()
```

Returns all notification channels belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.

### getNotificationChannelsCompat

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull List<NotificationChannelCompat> getNotificationChannelsCompat()
```

Returns all notification channels belonging to the calling app or an empty list on older SDKs which don't support Notification Channels.

### notify

Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/core#1.11.0)

```
@RequiresPermission(value = Manifest.permission.POST_NOTIFICATIONS)
public void notify(
    @NonNull List<NotificationManagerCompat.NotificationWithIdAndTag> notificationWithIdAndTags
)
```

Post a number of notifications, to be shown in the status bar, stream, etc. Each notification will attempt to be posted in the order provided in the `
notificationWithIds` list. Each notification must have a provided id and may have a provided tag. This is the preferred method for posting groups of notifications, to improve sound and animation behavior.

### notify

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
@RequiresPermission(value = Manifest.permission.POST_NOTIFICATIONS)
public void notify(int id, @NonNull Notification notification)
```

Post a notification to be shown in the status bar, stream, etc.

| Parameters |
|---|---|
| `int id` | the ID of the notification |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Notification.html notification` | the notification to post to the system |

### notify

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
@RequiresPermission(value = Manifest.permission.POST_NOTIFICATIONS)
public void notify(@Nullable String tag, int id, @NonNull Notification notification)
```

Post a notification to be shown in the status bar, stream, etc.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html tag` | the string identifier for a notification. Can be `null`. |
| `int id` | the ID of the notification. The pair (tag, id) must be unique within your app. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/app/Notification.html notification` | the notification to post to the system |