Stay organized with collections
Save and categorize content based on your preferences.
State
class State
Represents the computation state.
Summary
Enum values |
The task was cancelled.
|
The task completed with an exception.
|
The task has not completed.
|
The task completed with a result.
|
Enum values
CANCELLED
enum val CANCELLED : Future.State
The task was cancelled.
FAILED
enum val FAILED : Future.State
The task completed with an exception.
RUNNING
enum val RUNNING : Future.State
The task has not completed.
SUCCESS
enum val SUCCESS : Future.State
The task completed with a 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-03-13 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-03-13 UTC."],[],[],null,["# Future.State\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nState\n=====\n\n```\nclass State\n```\n\n|---|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[java.util.concurrent.Future.State](#)\\\u003e ||\n| | ↳ | [java.util.concurrent.Future.State](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [Future.State.CANCELLED](#ENUM_VALUE:CANCELLED), [Future.State.FAILED](#ENUM_VALUE:FAILED), [Future.State.RUNNING](#ENUM_VALUE:RUNNING), [Future.State.SUCCESS](#ENUM_VALUE:SUCCESS) |-------------------------------------------------|---------------------------------------| | [Future.State.CANCELLED](#ENUM_VALUE:CANCELLED) | The task was cancelled. | | [Future.State.FAILED](#ENUM_VALUE:FAILED) | The task completed with an exception. | | [Future.State.RUNNING](#ENUM_VALUE:RUNNING) | The task has not completed. | | [Future.State.SUCCESS](#ENUM_VALUE:SUCCESS) | The task completed with a result. | |\n\nRepresents the computation state.\n\nSummary\n-------\n\n| Enum values ||\n|--------------------------------------------------------------------|---|\n| [CANCELLED](#ENUM_VALUE:CANCELLED) The task was cancelled. |\n| [FAILED](#ENUM_VALUE:FAILED) The task completed with an exception. |\n| [RUNNING](#ENUM_VALUE:RUNNING) The task has not completed. |\n| [SUCCESS](#ENUM_VALUE:SUCCESS) The task completed with a result. |\n\nEnum values\n-----------\n\n### CANCELLED\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val CANCELLED : Future.State\n```\n\nThe task was cancelled. \n**See Also**\n\n- [#cancel(boolean)](/reference/kotlin/java/util/concurrent/Future#cancel(kotlin.Boolean)) \n\n### FAILED\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val FAILED : Future.State\n```\n\nThe task completed with an exception. \n**See Also**\n\n- [java.util.concurrent.Future#exceptionNow()](/reference/kotlin/java/util/concurrent/Future#exceptionNow()) \n\n### RUNNING\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val RUNNING : Future.State\n```\n\nThe task has not completed. \n\n### SUCCESS\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val SUCCESS : Future.State\n```\n\nThe task completed with a result. \n**See Also**\n\n- [java.util.concurrent.Future#resultNow()](/reference/kotlin/java/util/concurrent/Future#resultNow())"]]