ActivityResult

public final class ActivityResult


A container for an activity result as obtained from onActivityResult

See also
onActivityResult

Summary

Public constructors

ActivityResult(@NonNull int resultCode, @Nullable Intent data)

Create a new instance

Public methods

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

A readable representation of standard activity result codes

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

Extension functions

final int

Destructuring declaration for ActivityResult to provide the requestCode

final @Nullable Intent

Destructuring declaration for ActivityResult to provide the intent

Constants

CREATOR

@NonNull
public static final @NonNull Parcelable.Creator<@NonNull ActivityResultCREATOR

Public constructors

ActivityResult

public ActivityResult(@NonNull int resultCode, @Nullable Intent data)

Create a new instance

Parameters
@NonNull int resultCode

status to indicate the success of the operation

@Nullable Intent data

an intent that carries the result data

Public methods

describeContents

@Override
@NonNull
public @Override int describeContents()

getData

@Nullable
@NonNull
public Intent getData()
Returns
Intent

the intent

getResultCode

@NonNull
public int getResultCode()
Returns
int

the resultCode

resultCodeToString

@NonNull
public static String resultCodeToString(@NonNull int resultCode)

A readable representation of standard activity result codes

Parameters
@NonNull int resultCode

the result code

Returns
String

RESULT_OK, RESULT_CANCELED, or the number otherwise

toString

@Override
@NonNull
public @Override String toString()

writeToParcel

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

Extension functions

ActivityResultKt.component1

@NonNull
public final int ActivityResultKt.component1(@NonNull ActivityResult receiver)

Destructuring declaration for ActivityResult to provide the requestCode

Returns
int

the resultCode of the ActivityResult

ActivityResultKt.component2

@Nullable
public final Intent ActivityResultKt.component2(@