ActivityCallContractHandler

Lifecycle-aware holder for an ActivityResultContract launcher.

This packages result registration into a DefaultLifecycleObserver, reducing the boilerplate around ActivityResultRegistry.register.

Inheritors

Types

Link copied to clipboard
abstract class Impl<I, O>(val resultRegistry: ActivityResultRegistry, val resultContract: ActivityResultContract<I, O>) : ActivityCallContractHandler<I, O>

Base implementation that registers resultContract during onCreate.

Properties

Link copied to clipboard
abstract val registryKey: String

Key used when registering with resultRegistry.

Link copied to clipboard
abstract val resultCallback: (O) -> Unit

Callback invoked with the contract output.

Link copied to clipboard

Contract that converts inputs and outputs for the activity call.

Link copied to clipboard

Launcher created during lifecycle registration.

Link copied to clipboard

Registry used to create the launcher.

Functions

Link copied to clipboard
open fun onCreate(owner: LifecycleOwner)
Link copied to clipboard
open fun onDestroy(owner: LifecycleOwner)
Link copied to clipboard
open fun onPause(owner: LifecycleOwner)
Link copied to clipboard
open fun onResume(owner: LifecycleOwner)
Link copied to clipboard
open fun onStart(owner: LifecycleOwner)
Link copied to clipboard
open fun onStop(owner: LifecycleOwner)