# ActivityResult

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/result/ActivityResult.kt+class:androidx.activity.result.ActivityResult) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

*** ** * ** ***

<br />

```
class ActivityResult : Parcelable
```

<br />

*** ** * ** ***

A container for an activity result as obtained from `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)`

| See also |
|---|---|
| `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` |   |

## Summary

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#resultCodeToString(kotlin.Int)(resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` A readable representation of standard activity result codes for the given `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult.Companion#resultCodeToString(kotlin.Int)` |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/android/os/Parcelable.Creator.html<https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult>` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#CREATOR()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#ActivityResult(kotlin.Int,android.content.Intent)(resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, data: https://developer.android.com/reference/android/content/Intent.html?)` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#describeContents()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#toString()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#writeToParcel(android.os.Parcel,kotlin.Int)(dest: https://developer.android.com/reference/android/os/Parcel.html, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html?` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#data()` The intent that carries the result data |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#resultCode()` Status to indicate the success of the operation |

| ### Extension functions |
|---|---|
| `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult.https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#(androidx.activity.result.ActivityResult).component1()()` Destructuring declaration for `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` to provide the requestCode |
| `operator https://developer.android.com/reference/android/content/Intent.html?` | `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult.https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult#(androidx.activity.result.ActivityResult).component2()()` Destructuring declaration for `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` to provide the intent |

## Public companion functions

### resultCodeToString

Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/activity#1.9.0)

```
fun resultCodeToString(resultCode: Int): String
```

A readable representation of standard activity result codes for the given `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult.Companion#resultCodeToString(kotlin.Int)`

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | RESULT_OK, RESULT_CANCELED, or the number otherwise |

## Public companion properties

### CREATOR

```
val CREATOR: Parcelable.Creator<ActivityResult>
```

## Public constructors

### ActivityResult

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

```
ActivityResult(resultCode: Int, data: Intent?)
```

## Public functions

### describeContents

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

```
open fun describeContents(): Int
```

### toString

```
open fun toString(): String
```

### writeToParcel

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

```
open fun writeToParcel(dest: Parcel, flags: Int): Unit
```

## Public properties

### data

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

```
val data: Intent?
```

The intent that carries the result data

### resultCode

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

```
val resultCode: Int
```

Status to indicate the success of the operation

## Extension functions

### ActivityResult.component1

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/result/ActivityResult.kt+function:component1)

```
operator fun ActivityResult.component1(): Int
```

Destructuring declaration for `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` to provide the requestCode

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the resultCode of the `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` |

### ActivityResult.component2

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/result/ActivityResult.kt+function:component2)

```
operator fun ActivityResult.component2(): Intent?
```

Destructuring declaration for `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` to provide the intent

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html?` | the intent of the `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` |