# PendingIntentCompat

# PendingIntentCompat

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/app/PendingIntentCompat "View this page in Java")

<br />

```
class PendingIntentCompat
```

<br />

*** ** * ** ***

Helper for accessing features in[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html).

## Summary

|                                           ### Public functions                                           |
|----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)    | [getActivities](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getActivities(android.content.Context,int,android.content.Intent[],int,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intents: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`!>,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)    | [getActivities](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getActivities(android.content.Context,int,android.content.Intent[],int,android.os.Bundle,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intents: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`!>,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` options: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | [getActivity](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getActivity(android.content.Context,int,android.content.Intent,int,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | [getActivity](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getActivity(android.content.Context,int,android.content.Intent,int,android.os.Bundle,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` options: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | [getBroadcast](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getBroadcast(android.content.Context,int,android.content.Intent,int,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)    | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 26)` [getForegroundService](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getForegroundService(android.content.Context,int,android.content.Intent,int,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `java-static `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | [getService](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#getService(android.content.Context,int,android.content.Intent,int,boolean))`(` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` requestCode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` isMutable: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)              | [send](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#send(android.app.PendingIntent,int,android.app.PendingIntent.OnFinished,android.os.Handler))`(` ` pendingIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`,` ` code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` onFinished: `[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)`?,` ` handler: `[Handler](https://developer.android.com/reference/android/os/Handler.html)`?` `)` [send](https://developer.android.com/reference/android/app/PendingIntent.html#send())variants that support[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks have a bug on many API levels that the callback may be invoked even if the PendingIntent was never sent (ie, such as if the PendingIntent was canceled, and the send() invocation threw a[PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)              | [send](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#send(android.app.PendingIntent,android.content.Context,int,android.content.Intent,android.app.PendingIntent.OnFinished,android.os.Handler))`(` ` pendingIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`,` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` onFinished: `[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)`?,` ` handler: `[Handler](https://developer.android.com/reference/android/os/Handler.html)`?` `)` [send](https://developer.android.com/reference/android/app/PendingIntent.html#send())variants that support[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks have a bug on many API levels that the callback may be invoked even if the PendingIntent was never sent (ie, such as if the PendingIntent was canceled, and the send() invocation threw a[PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html)).                                                                                                                                                                                                                                           |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)              | [send](https://developer.android.com/reference/kotlin/androidx/core/app/PendingIntentCompat#send(android.app.PendingIntent,android.content.Context,int,android.content.Intent,android.app.PendingIntent.OnFinished,android.os.Handler,java.lang.String,android.os.Bundle))`(` ` pendingIntent: `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`,` ` context: `[Context](https://developer.android.com/reference/android/content/Context.html)`,` ` code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` intent: `[Intent](https://developer.android.com/reference/android/content/Intent.html)`,` ` onFinished: `[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)`?,` ` handler: `[Handler](https://developer.android.com/reference/android/os/Handler.html)`?,` ` requiredPermissions: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?,` ` options: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?` `)` [send](https://developer.android.com/reference/android/app/PendingIntent.html#send())variants that support[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks have a bug on many API levels that the callback may be invoked even if the PendingIntent was never sent (ie, such as if the PendingIntent was canceled, and the send() invocation threw a[PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html)). |

## Public functions

### getActivities

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

```
java-static fun getActivities(
    context: Context,
    requestCode: Int,
    intents: Array<Intent!>,
    flags: Int,
    isMutable: Boolean
): PendingIntent
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary. See[getActivities](https://developer.android.com/reference/android/app/PendingIntent.html#getActivities(android.content.Context, int, android.content.Intent[], int, android.os.Bundle)).  

### getActivities

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

```
java-static fun getActivities(
    context: Context,
    requestCode: Int,
    intents: Array<Intent!>,
    flags: Int,
    options: Bundle?,
    isMutable: Boolean
): PendingIntent
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary. See[getActivities](https://developer.android.com/reference/android/app/PendingIntent.html#getActivities(android.content.Context, int, android.content.Intent[], int, android.os.Bundle)).  

### getActivity

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

```
java-static fun getActivity(
    context: Context,
    requestCode: Int,
    intent: Intent,
    flags: Int,
    isMutable: Boolean
): PendingIntent?
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary.  

|                                          Returns                                           |
|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | Returns an existing or new PendingIntent matching the given parameters. May return`null`only if[FLAG_NO_CREATE](https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_NO_CREATE())has been supplied. |

|                                                                           See also                                                                           |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getActivity](https://developer.android.com/reference/android/app/PendingIntent.html#getActivity(android.content.Context, int, android.content.Intent, int)) |   |

### getActivity

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

```
java-static fun getActivity(
    context: Context,
    requestCode: Int,
    intent: Intent,
    flags: Int,
    options: Bundle?,
    isMutable: Boolean
): PendingIntent?
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary.  

|                                          Returns                                           |
|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | Returns an existing or new PendingIntent matching the given parameters. May return`null`only if[FLAG_NO_CREATE](https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_NO_CREATE())has been supplied. |

|                                                                                    See also                                                                                     |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getActivity](https://developer.android.com/reference/android/app/PendingIntent.html#getActivity(android.content.Context, int, android.content.Intent, int, android.os.Bundle)) |   |

### getBroadcast

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

```
java-static fun getBroadcast(
    context: Context,
    requestCode: Int,
    intent: Intent,
    flags: Int,
    isMutable: Boolean
): PendingIntent?
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary.  

|                                          Returns                                           |
|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | Returns an existing or new PendingIntent matching the given parameters. May return`null`only if[FLAG_NO_CREATE](https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_NO_CREATE())has been supplied. |

|                                                                            See also                                                                            |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getBroadcast](https://developer.android.com/reference/android/app/PendingIntent.html#getBroadcast(android.content.Context, int, android.content.Intent, int)) |   |

### getForegroundService

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

```
@RequiresApi(value = 26)
java-static fun getForegroundService(
    context: Context,
    requestCode: Int,
    intent: Intent,
    flags: Int,
    isMutable: Boolean
): PendingIntent
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary. See[getForegroundService](https://developer.android.com/reference/android/app/PendingIntent.html#getForegroundService(android.content.Context, int, android.content.Intent, int)).  

### getService

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

```
java-static fun getService(
    context: Context,
    requestCode: Int,
    intent: Intent,
    flags: Int,
    isMutable: Boolean
): PendingIntent?
```

Retrieves a[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)with mandatory mutability flag set on supported platform versions. The caller provides the flag as combination of all the other values except mutability flag. This method combines mutability flag when necessary.  

|                                          Returns                                           |
|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PendingIntent](https://developer.android.com/reference/android/app/PendingIntent.html)`?` | Returns an existing or new PendingIntent matching the given parameters. May return`null`only if[FLAG_NO_CREATE](https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_NO_CREATE())has been supplied. |

|                                                                          See also                                                                          |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getService](https://developer.android.com/reference/android/app/PendingIntent.html#getService(android.content.Context, int, android.content.Intent, int)) |   |

### send

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

```
java-static fun send(
    pendingIntent: PendingIntent,
    code: Int,
    onFinished: PendingIntent.OnFinished?,
    handler: Handler?
): Unit
```

[send](https://developer.android.com/reference/android/app/PendingIntent.html#send())variants that support[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks have a bug on many API levels that the callback may be invoked even if the PendingIntent was never sent (ie, such as if the PendingIntent was canceled, and the send() invocation threw a[PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html)). Using this compatibility method fixes that bug and guarantees that[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks will only be invoked if send() completed successfully.

See[send](https://developer.android.com/reference/android/app/PendingIntent.html#send(int, android.app.PendingIntent.OnFinished, android.os.Handler)).  

|                                                                 Throws                                                                  |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [android.app.PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html) |   |

### send

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

```
java-static fun send(
    pendingIntent: PendingIntent,
    context: Context,
    code: Int,
    intent: Intent,
    onFinished: PendingIntent.OnFinished?,
    handler: Handler?
): Unit
```

[send](https://developer.android.com/reference/android/app/PendingIntent.html#send())variants that support[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks have a bug on many API levels that the callback may be invoked even if the PendingIntent was never sent (ie, such as if the PendingIntent was canceled, and the send() invocation threw a[PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html)). Using this compatibility method fixes that bug and guarantees that[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks will only be invoked if send() completed successfully.

See[send](https://developer.android.com/reference/android/app/PendingIntent.html#send(android.content.Context, int, android.content.Intent, android.app.PendingIntent.OnFinished, android.os.Handler)).  

|                                                                 Throws                                                                  |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [android.app.PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html) |   |

### send

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

```
java-static fun send(
    pendingIntent: PendingIntent,
    context: Context,
    code: Int,
    intent: Intent,
    onFinished: PendingIntent.OnFinished?,
    handler: Handler?,
    requiredPermissions: String?,
    options: Bundle?
): Unit
```

[send](https://developer.android.com/reference/android/app/PendingIntent.html#send())variants that support[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks have a bug on many API levels that the callback may be invoked even if the PendingIntent was never sent (ie, such as if the PendingIntent was canceled, and the send() invocation threw a[PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html)). Using this compatibility method fixes that bug and guarantees that[PendingIntent.OnFinished](https://developer.android.com/reference/android/app/PendingIntent.OnFinished.html)callbacks will only be invoked if send() completed successfully.

See[send](https://developer.android.com/reference/android/app/PendingIntent.html#send(android.content.Context, int, android.content.Intent, android.app.PendingIntent.OnFinished, android.os.Handler, java.lang.String, android.os.Bundle))  

|                                                                 Throws                                                                  |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [android.app.PendingIntent.CanceledException](https://developer.android.com/reference/android/app/PendingIntent.CanceledException.html) |   |