Stay organized with collections
Save and categorize content based on your preferences.
Result
class Result
This API is not generally intended for third party application developers. Use the AndroidX Media3 session Library for consistent behavior across all devices.
Contains the result of Session2Command
.
Summary
Constants |
static Int |
Result code represents that call is ended with an unknown error.
|
static Int |
Result code representing that the command is skipped or canceled.
|
static Int |
Result code representing that the command is successfully completed.
|
Public constructors |
Constructor of Result .
|
Public methods |
Int |
Returns the result code.
|
Bundle? |
Returns the result data.
|
Constants
RESULT_ERROR_UNKNOWN_ERROR
static val RESULT_ERROR_UNKNOWN_ERROR: Int
Result code represents that call is ended with an unknown error.
Value: -1
RESULT_INFO_SKIPPED
static val RESULT_INFO_SKIPPED: Int
Result code representing that the command is skipped or canceled. For an example, a seek command can be skipped if it is followed by another seek command.
Value: 1
RESULT_SUCCESS
static val RESULT_SUCCESS: Int
Result code representing that the command is successfully completed.
Value: 0
Public constructors
Result
Result(
resultCode: Int,
resultData: Bundle?)
Constructor of Result
.
Parameters |
resultCode |
Int: result code |
resultData |
Bundle?: result data This value may be null . |
Public methods
getResultCode
fun getResultCode(): Int
Returns the result code.
getResultData
fun getResultData(): Bundle?
Returns the result data.
Return |
Bundle? |
This value may be null . |
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,["# Session2Command.Result\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nResult\n======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/Session2Command.Result \"View this page in Java\") \n\n```\nclass Result\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.Session2Command.Result](#) |\n\nThis API is not generally intended for third party application developers. Use the [AndroidX](https://developer.android.com/jetpack/androidx.html) [Media3 session Library](https://developer.android.com/media/media3/session/control-playback) for consistent behavior across all devices.\n\nContains the result of [Session2Command](/reference/kotlin/android/media/Session2Command).\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RESULT_ERROR_UNKNOWN_ERROR](#RESULT_ERROR_UNKNOWN_ERROR:kotlin.Int) Result code represents that call is ended with an unknown error. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RESULT_INFO_SKIPPED](#RESULT_INFO_SKIPPED:kotlin.Int) Result code representing that the command is skipped or canceled. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [RESULT_SUCCESS](#RESULT_SUCCESS:kotlin.Int) Result code representing that the command is successfully completed. |\n\n| Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Result](#Result(kotlin.Int,%20android.os.Bundle))`(`resultCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `resultData:` `[Bundle](../os/Bundle.html#)?`)` Constructor of [Result](#). |\n\n| Public methods ||\n|----------------------------------------------------------------------------|----------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getResultCode](#getResultCode())`()` Returns the result code. |\n| [Bundle](../os/Bundle.html#)? | [getResultData](#getResultData())`()` Returns the result data. |\n\nConstants\n---------\n\n### RESULT_ERROR_UNKNOWN_ERROR\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val RESULT_ERROR_UNKNOWN_ERROR: Int\n```\n\nResult code represents that call is ended with an unknown error. \n\n Value: -1\n\n### RESULT_INFO_SKIPPED\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val RESULT_INFO_SKIPPED: Int\n```\n\nResult code representing that the command is skipped or canceled. For an example, a seek command can be skipped if it is followed by another seek command. \n\n Value: 1\n\n### RESULT_SUCCESS\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val RESULT_SUCCESS: Int\n```\n\nResult code representing that the command is successfully completed. \n\n Value: 0\n\nPublic constructors\n-------------------\n\n### Result\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nResult(\n resultCode: Int, \n resultData: Bundle?)\n```\n\nConstructor of [Result](#).\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------|\n| `resultCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): result code |\n| `resultData` | [Bundle](../os/Bundle.html#)?: result data This value may be `null`. |\n\nPublic methods\n--------------\n\n### getResultCode\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getResultCode(): Int\n```\n\nReturns the result code. \n\n### getResultData\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getResultData(): Bundle?\n```\n\nReturns the result data.\n\n| Return ||\n|-------------------------------|---------------------------|\n| [Bundle](../os/Bundle.html#)? | This value may be `null`. |"]]