# Camera.ErrorCallback

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# Camera.ErrorCallback

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/hardware/Camera.ErrorCallback "View this page in Kotlin")\|Java

`
public
static


interface
Camera.ErrorCallback
`  
`


`

|---------------------------------------|
| android.hardware.Camera.ErrorCallback |

<br />

*** ** * ** ***

<br />

**This interface was deprecated in API level 21.**   
We recommend using the new[android.hardware.camera2](https://developer.android.com/reference/android/hardware/camera2/package-summary)API for new applications.

Callback interface for camera error notification.  
**See also:**

- [Camera.setErrorCallback(ErrorCallback)](https://developer.android.com/reference/android/hardware/Camera#setErrorCallback(android.hardware.Camera.ErrorCallback))

## Summary

|                                                                                                                                 ### Public methods                                                                                                                                  ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onError](https://developer.android.com/reference/android/hardware/Camera.ErrorCallback#onError(int,%20android.hardware.Camera))`(int error, `[Camera](https://developer.android.com/reference/android/hardware/Camera)` camera) ` Callback for camera errors. |

## Public methods

### onError

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void onError (int error, 
                Camera camera)
```

Callback for camera errors.

<br />

|                                                                                                                                       Parameters                                                                                                                                        ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `error`  | `int`: error code: - [Camera.CAMERA_ERROR_UNKNOWN](https://developer.android.com/reference/android/hardware/Camera#CAMERA_ERROR_UNKNOWN) - [Camera.CAMERA_ERROR_SERVER_DIED](https://developer.android.com/reference/android/hardware/Camera#CAMERA_ERROR_SERVER_DIED) <br /> |
| `camera` | `Camera`: the Camera service object <br />                                                                                                                                                                                                                                    |