Stay organized with collections
Save and categorize content based on your preferences.
ActivityResult
class ActivityResult
Description of a Activity execution result to return to the original activity.
Summary
Public constructors |
Create a new activity result.
|
Public methods |
Int |
Retrieve the result code contained in this result.
|
Intent! |
Retrieve the data contained in this result.
|
Public constructors
ActivityResult
ActivityResult(
resultCode: Int,
resultData: Intent!)
Create a new activity result. See android.app.Activity#setResult for more information.
Parameters |
resultCode |
Int: The result code to propagate back to the originating activity, often RESULT_CANCELED or RESULT_OK |
resultData |
Intent!: The data to propagate back to the originating activity. |
Public methods
getResultCode
fun getResultCode(): Int
Retrieve the result code contained in this result.
getResultData
fun getResultData(): Intent!
Retrieve the data contained in this result.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Instrumentation.ActivityResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nActivityResult\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/Instrumentation.ActivityResult \"View this page in Java\") \n\n```\nclass ActivityResult\n```\n\n|---|-------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.Instrumentation.ActivityResult](#) |\n\nDescription of a Activity execution result to return to the original activity.\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ActivityResult](#ActivityResult(kotlin.Int,%20android.content.Intent))`(`resultCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `resultData:` `[Intent](../content/Intent.html#)!`)` Create a new activity result. |\n\n| Public methods ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getResultCode](#getResultCode())`()` Retrieve the result code contained in this result. |\n| [Intent](../content/Intent.html#)! | [getResultData](#getResultData())`()` Retrieve the data contained in this result. |\n\nPublic constructors\n-------------------\n\n### ActivityResult\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nActivityResult(\n resultCode: Int, \n resultData: Intent!)\n```\n\nCreate a new activity result. See android.app.Activity#setResult for more information.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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 |\n| `resultData` | [Intent](../content/Intent.html#)!: The data to propagate back to the originating activity. |\n\nPublic methods\n--------------\n\n### getResultCode\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getResultCode(): Int\n```\n\nRetrieve the result code contained in this result. \n\n### getResultData\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getResultData(): Intent!\n```\n\nRetrieve the data contained in this result."]]