public final class

ActivityResultContracts.StartActivityForResult

extends ActivityResultContract<Intent, ActivityResult>

 java.lang.Object

androidx.activity.result.contract.ActivityResultContract<Intent, ActivityResult>

↳androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult

Overview

An ActivityResultContract that doesn't do any type conversion, taking raw as an input and ActivityResult as an output. Can be used with ActivityResultCaller.registerForActivityResult(ActivityResultContract, ActivityResultCallback) to avoid having to manage request codes when calling an activity API for which a type-safe contract is not available.

Summary

Fields
public static final java.lang.StringEXTRA_ACTIVITY_OPTIONS_BUNDLE

Key for the extra containing a generated from ActivityOptionsCompat.toBundle() or .

Constructors
publicStartActivityForResult()

Methods
public abstract IntentcreateIntent(Context context, java.lang.Object input)

Create an intent that can be used for

public abstract java.lang.ObjectparseResult(int resultCode, Intent intent)

Convert result obtained from to O

from ActivityResultContract<I, O>getSynchronousResult
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final java.lang.String EXTRA_ACTIVITY_OPTIONS_BUNDLE

Key for the extra containing a generated from ActivityOptionsCompat.toBundle() or . This will override any ActivityOptionsCompat passed to ActivityResultLauncher.launch(I, ActivityOptionsCompat)

Constructors

public StartActivityForResult()

Methods

public abstract Intent createIntent(Context context, java.lang.Object input)

Create an intent that can be used for

public abstract java.lang.Object parseResult(int resultCode, Intent intent)

Convert result obtained from to O