ActivityResult

public final class ActivityResult


A container for an activity result as obtained from onActivityResult

See also
onActivityResult

Summary

Constants

static final @NonNull Parcelable.Creator<ActivityResult>

Public constructors

ActivityResult(int resultCode, @Nullable Intent data)

Create a new instance

Public methods

@Override int
@Nullable Intent
int
static @NonNull String
resultCodeToString(int resultCode)

A readable representation of standard activity result codes

@Override String
@Override void
writeToParcel(@NonNull Parcel dest, int flags)

Extension functions

final int

Destructuring declaration for ActivityResult to provide the requestCode

final Intent

Destructuring declaration for ActivityResult to provide the intent

Constants

CREATOR

public static final @NonNull Parcelable.Creator<ActivityResultCREATOR

Public constructors

ActivityResult

public ActivityResult(int resultCode, @Nullable Intent data)

Create a new instance

Parameters
int resultCode

status to indicate the success of the operation

@Nullable Intent data

an intent that carries the result data

Public methods

describeContents

@Override
public int describeContents()

getData

public @Nullable Intent getData()
Returns
@Nullable Intent

the intent

getResultCode

public int getResultCode()
Returns
int

the resultCode

resultCodeToString

public static @NonNull String resultCodeToString(int resultCode)

A readable representation of standard activity result codes

Parameters
int resultCode

the result code

Returns
@NonNull String

RESULT_OK, RESULT_CANCELED, or the number otherwise

toString

@Override
public String toString()

writeToParcel

@Override
public void writeToParcel(@NonNull Parcel dest, int flags)

Extension functions

ActivityResultKt.component1

public final int ActivityResultKt.component1(ActivityResult receiver)

Destructuring declaration for ActivityResult to provide the requestCode

Returns
int

the resultCode of the ActivityResult

ActivityResultKt.component2

public final Intent ActivityResultKt.component2(ActivityResult receiver)

Destructuring declaration for ActivityResult to provide the intent

Returns
Intent

the intent of the ActivityResult