ActivityResultCaller

interface ActivityResultCaller

Known direct subclasses
ComponentActivity

Base class for activities that enables composition of higher level components.

Fragment

Static library support version of the framework's android.app.Fragment.

Known indirect subclasses
AbstractListDetailFragment

A fragment supports adaptive two-pane layout.

AbstractProgressFragment

The base class for Fragments that handle dynamic feature installation.

AmbientModeSupport

Use this as a headless Fragment to add ambient support to an Activity on Wearable devices.

AppCompatActivity

Base class for activities that wish to use some of the newer platform features on older Android devices.

AppCompatDialogFragment

A special version of DialogFragment which uses an AppCompatDialog in place of a platform-styled dialog.

BaseLeanbackPreferenceFragmentCompat

This fragment provides a preference fragment with leanback-style behavior, suitable for embedding into broader UI elements.

BaseSupportFragment

Base class for leanback Fragments.

BrandedSupportFragment

Fragment class for managing search and branding using a view that implements TitleViewAdapter.Provider.

BrowseSupportFragment

A fragment for creating Leanback browse screens.

CarAppActivity

The class representing a car app activity.

DefaultProgressFragment

The default androidx.fragment.app.Fragment to display during installation progress.

DetailsSupportFragment

A fragment for creating Leanback details screens.

DialogFragment

Static library support version of the framework's android.app.DialogFragment.

DynamicNavHostFragment

The NavHostFragment for dynamic features.

EditTextPreferenceDialogFragmentCompat
ErrorSupportFragment

A fragment for displaying an error indication.

FragmentActivity

Base class for activities that want to use the support-based Fragments.

GuidedStepSupportFragment

A GuidedStepSupportFragment is used to guide the user through a decision or series of decisions.

LeanbackEditTextPreferenceDialogFragmentCompat

Implemented a dialog to input text.

LeanbackListPreferenceDialogFragmentCompat

Implemented a dialog to show ListPreference or MultiSelectListPreference.

LeanbackPreferenceDialogFragmentCompat

A fragment that shows DialogPreference, for example or androidx.preference.MultiSelectListPreference.

LeanbackPreferenceFragmentCompat

This fragment provides a fully decorated leanback-style preference fragment, including a list background and header.

LeanbackSettingsFragmentCompat

This fragment provides a container for displaying a LeanbackPreferenceFragmentCompat

ListFragment

Static library support version of the framework's android.app.ListFragment.

ListPreferenceDialogFragmentCompat
MediaRouteChooserDialogFragment

Media route chooser dialog fragment.

MediaRouteControllerDialogFragment

Media route controller dialog fragment.

MediaRouteDiscoveryFragment

Media route discovery fragment.

MultiSelectListPreferenceDialogFragmentCompat
NavHostFragment

NavHostFragment provides an area within your layout for self-contained navigation to occur.

OnboardingSupportFragment

An OnboardingSupportFragment provides a common and simple way to build onboarding screen for applications.

PlaybackSupportFragment

A fragment for displaying playback controls and related content.

PreferenceDialogFragmentCompat

Abstract base class which presents a dialog associated with a DialogPreference.

PreferenceFragmentCompat

A PreferenceFragmentCompat is the entry point to using the Preference library.

SearchSupportFragment

A fragment to handle searches.

VerticalGridSupportFragment

A fragment for creating leanback vertical grids.

VideoSupportFragment

Subclass of PlaybackSupportFragment that is responsible for providing a SurfaceView and rendering video.


A class that can call startActivityForResult-style APIs without having to manage request codes, and converting request/response to an Intent

Summary

Public methods

abstract @NonNull ActivityResultLauncher<@NonNull I>

Register a request to start an activity for result, designated by the given contract.

abstract @NonNull ActivityResultLauncher<@NonNull I>

Register a request to start an activity for result, designated by the given contract.

Extension functions

final @NonNull ActivityResultLauncher<Unit>
<I extends Object, O extends Object> ActivityResultCallerKt.registerForActivityResult(
    @NonNull ActivityResultCaller receiver,
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull I input,
    @NonNull ActivityResultRegistry registry,
    @NonNull Function1<@NonNull O, Unit> callback
)

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

final @NonNull ActivityResultLauncher<Unit>
<I extends Object, O extends Object> ActivityResultCallerKt.registerForActivityResult(
    @NonNull ActivityResultCaller receiver,
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull I input,
    @NonNull Function1<@NonNull O, Unit> callback
)

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

Public methods

registerForActivityResult

@NonNull
public abstract ActivityResultLauncher<@NonNull I> <I, O> registerForActivityResult(
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull ActivityResultCallback<@NonNull O> callback
)

Register a request to start an activity for result, designated by the given contract. This creates a record in the registry associated with this caller, managing request code, as well as conversions to/from Intent under the hood. This *must* be called unconditionally, as part of initialization path, typically as a field initializer of an Activity or Fragment.

Parameters
<I>

the type of the input(if any) required to call the activity

<O>

the type of output returned as an activity result

@NonNull ActivityResultContract<@NonNull I, @NonNull O> contract

the contract, specifying conversions to/from Intents

@NonNull ActivityResultCallback<@NonNull O> callback

the callback to be called on the main thread when activity result is available

Returns
ActivityResultLauncher<@NonNull I>

the launcher that can be used to start the activity or dispose of the prepared call.

registerForActivityResult

@NonNull
public abstract ActivityResultLauncher<@NonNull I> <I, O> registerForActivityResult(
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull ActivityResultRegistry registry,
    @NonNull ActivityResultCallback<@NonNull O> callback
)

Register a request to start an activity for result, designated by the given contract. This creates a record in the given registry, managing request code, as well as conversions to/from Intent under the hood. This *must* be called unconditionally, as part of initialization path, typically as a field initializer of an Activity or Fragment.

Parameters
<I>

the type of the input(if any) required to call the activity

<O>

the type of output returned as an activity result

@NonNull ActivityResultContract<@NonNull I, @NonNull O> contract

the contract, specifying conversions to/from Intents

@NonNull ActivityResultRegistry registry

the registry where to hold the record.

@NonNull ActivityResultCallback<@NonNull O> callback

the callback to be called on the main thread when activity result is available

Returns
ActivityResultLauncher<@NonNull I>

the launcher that can be used to start the activity or dispose of the prepared call.

Extension functions

ActivityResultCallerKt.registerForActivityResult

@NonNull
public final ActivityResultLauncher<Unit> <I extends Object, O extends Object> ActivityResultCallerKt.registerForActivityResult(
    @NonNull ActivityResultCaller receiver,
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull I input,
    @NonNull ActivityResultRegistry registry,
    @NonNull Function1<@NonNull O, Unit> callback
)

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

ActivityResultCallerKt.registerForActivityResult

@NonNull
public final ActivityResultLauncher<Unit> <I extends Object, O extends Object> ActivityResultCallerKt.registerForActivityResult(
    @NonNull ActivityResultCaller receiver,
    @NonNull ActivityResultContract<@NonNull I, @NonNull O> contract,
    @NonNull I input,
    @NonNull Function1<@NonNull O, Unit> callback
)

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.