Stay organized with collections
Save and categorize content based on your preferences.
ErrorCallback
interface ErrorCallback
Callback interface for camera error notification.
Summary
Public methods |
abstract Unit |
Callback for camera errors.
|
Public methods
onError
abstract fun onError(
error: Int,
camera: Camera!
): Unit
Deprecated: Deprecated in Java.
Callback for camera errors.
Parameters |
error |
Int: error code:
|
camera |
Camera!: the Camera service object |
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,["# Camera.ErrorCallback\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nErrorCallback\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/Camera.ErrorCallback \"View this page in Java\") \n\n```\ninterface ErrorCallback\n```\n\n|--------------------------------------------|\n| [android.hardware.Camera.ErrorCallback](#) |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 21.**\n|\n| We recommend using the new [android.hardware.camera2](/reference/kotlin/android/hardware/camera2/package-summary) API for new applications.\n\nCallback interface for camera error notification.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(kotlin.Int,%20android.hardware.Camera))`(`error:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `camera:` `[Camera](/reference/kotlin/android/hardware/Camera)!`)` Callback for camera errors. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onError(\n error: Int, \n camera: Camera!\n): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCallback for camera errors.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): error code: - [CAMERA_ERROR_UNKNOWN](/reference/kotlin/android/hardware/Camera#CAMERA_ERROR_UNKNOWN:kotlin.Int) - [CAMERA_ERROR_SERVER_DIED](/reference/kotlin/android/hardware/Camera#CAMERA_ERROR_SERVER_DIED:kotlin.Int) |\n| `camera` | [Camera](/reference/kotlin/android/hardware/Camera)!: the Camera service object |"]]