Stay organized with collections
Save and categorize content based on your preferences.
OnErrorListener
interface OnErrorListener
Interface definition of a callback to be invoked when there has been an error during an asynchronous operation (other errors will throw exceptions at method call time).
Summary
Public methods |
abstract Unit |
Called to indicate an error.
|
Public methods
onError
abstract fun onError(
sync: MediaSync,
what: Int,
extra: Int
): Unit
Called to indicate an error.
Parameters |
sync |
MediaSync: The MediaSync the error pertains to This value cannot be null . |
what |
Int: The type of error that has occurred:
|
extra |
Int: an extra code, specific to the error. Typically implementation dependent. |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MediaSync.OnErrorListener\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnErrorListener\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaSync.OnErrorListener \"View this page in Java\") \n\n```\ninterface OnErrorListener\n```\n\n|----------------------------------------------|\n| [android.media.MediaSync.OnErrorListener](#) |\n\nInterface definition of a callback to be invoked when there has been an error during an asynchronous operation (other errors will throw exceptions at method call time).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(android.media.MediaSync,%20kotlin.Int,%20kotlin.Int))`(`sync:` `[MediaSync](/reference/kotlin/android/media/MediaSync)`, `what:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `extra:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called to indicate an error. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onError(\n sync: MediaSync, \n what: Int, \n extra: Int\n): Unit\n```\n\nCalled to indicate an error.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sync` | [MediaSync](/reference/kotlin/android/media/MediaSync): The MediaSync the error pertains to This value cannot be `null`. |\n| `what` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The type of error that has occurred: - [MEDIASYNC_ERROR_AUDIOTRACK_FAIL](/reference/kotlin/android/media/MediaSync#MEDIASYNC_ERROR_AUDIOTRACK_FAIL:kotlin.Int) - [MEDIASYNC_ERROR_SURFACE_FAIL](/reference/kotlin/android/media/MediaSync#MEDIASYNC_ERROR_SURFACE_FAIL:kotlin.Int) |\n| `extra` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): an extra code, specific to the error. Typically implementation dependent. |"]]