# Instrumentation.ActivityResult

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# ActivityResult

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult "View this page in Java")  

```
class ActivityResult
```

|---|------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                           ||
| ↳ | [android.app.Instrumentation.ActivityResult](https://developer.android.com/reference/kotlin/android/app/Instrumentation.ActivityResult#) |

Description of a Activity execution result to return to the original activity.

## Summary

|                                                                                                                                                                                           Public constructors                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [ActivityResult](https://developer.android.com/reference/kotlin/android/app/Instrumentation.ActivityResult#ActivityResult(kotlin.Int,%20android.content.Intent))`(`resultCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `resultData:` `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)!`)` Create a new activity result. |

|                                                                                                                              Public methods                                                                                                                               ||
|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)             | [getResultCode](https://developer.android.com/reference/kotlin/android/app/Instrumentation.ActivityResult#getResultCode())`()` Retrieve the result code contained in this result. |
| [Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)! | [getResultData](https://developer.android.com/reference/kotlin/android/app/Instrumentation.ActivityResult#getResultData())`()` Retrieve the data contained in this result.        |

## Public constructors

### ActivityResult

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
ActivityResult(
    resultCode: Int, 
    resultData: Intent!)
```

Create a new activity result. See android.app.Activity#setResult for more information.

|                                                                                         Parameters                                                                                         ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `resultCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK |
| `resultData` | [Intent](https://developer.android.com/reference/kotlin/android/content/Intent.html#)!:The data to propagate back to the originating activity.                               |

## Public methods

### getResultCode

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getResultCode(): Int
```

Retrieve the result code contained in this result.  

### getResultData

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getResultData(): Intent!
```

Retrieve the data contained in this result.