PendingIntentCompat


class PendingIntentCompat


Helper for accessing features in PendingIntent.

Summary

Public functions

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

Retrieves a PendingIntent with mandatory mutability flag set on supported platform versions.

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

send variants that support PendingIntent.OnFinished 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).

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

send variants that support PendingIntent.OnFinished 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).

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

send variants that support PendingIntent.OnFinished 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).

Public functions

getActivities

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

Retrieves a PendingIntent 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.

getActivities

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

Retrieves a PendingIntent 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.

getActivity

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

Retrieves a PendingIntent 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?

Returns an existing or new PendingIntent matching the given parameters. May return null only if FLAG_NO_CREATE has been supplied.

See also
getActivity

getActivity

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

Retrieves a PendingIntent 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?

Returns an existing or new PendingIntent matching the given parameters. May return null only if FLAG_NO_CREATE has been supplied.

See also
getActivity

getBroadcast

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

Retrieves a PendingIntent 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?

Returns an existing or new PendingIntent matching the given parameters. May return null only if FLAG_NO_CREATE has been supplied.

See also
getBroadcast

getForegroundService

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

Retrieves a PendingIntent 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 .

getService

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

Retrieves a PendingIntent 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?

Returns an existing or new PendingIntent matching the given parameters. May return null only if FLAG_NO_CREATE has been supplied.

See also
getService

send

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

send variants that support PendingIntent.OnFinished 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). Using this compatibility method fixes that bug and guarantees that PendingIntent.OnFinished callbacks will only be invoked if send() completed successfully.

See send.

send

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

send variants that support PendingIntent.OnFinished 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). Using this compatibility method fixes that bug and guarantees that PendingIntent.OnFinished callbacks will only be invoked if send() completed successfully.

See send.

send

Added in 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 variants that support PendingIntent.OnFinished 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). Using this compatibility method fixes that bug and guarantees that PendingIntent.OnFinished callbacks will only be invoked if send() completed successfully.

See send