Added in API level 21

CameraAccessException


open class CameraAccessException : AndroidException
kotlin.Any
   ↳ kotlin.Throwable
   ↳ java.lang.Exception
   ↳ android.util.AndroidException
   ↳ android.hardware.camera2.CameraAccessException

CameraAccessException is thrown if a camera device could not be queried or opened by the CameraManager, or if the connection to an opened CameraDevice is no longer valid.

Summary

Constants
static Int

The camera is disabled due to a device policy, and cannot be opened.

static Int

The camera device is removable and has been disconnected from the Android device, or the camera id used with android.

static Int

The camera device is currently in the error state.

static Int

The camera device is in use already.

static Int

The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened or torch mode cannot be turned on until previous instances are closed.

Public constructors

CameraAccessException(problem: Int, message: String!)

CameraAccessException(problem: Int, message: String!, cause: Throwable!)

CameraAccessException(problem: Int, cause: Throwable!)

Public methods
Int

The reason for the failure to access the camera.

Constants

CAMERA_DISABLED

Added in API level 21
static val CAMERA_DISABLED: Int

The camera is disabled due to a device policy, and cannot be opened.

Value: 1

CAMERA_DISCONNECTED

Added in API level 21
static val CAMERA_DISCONNECTED: Int

The camera device is removable and has been disconnected from the Android device, or the camera id used with android.hardware.camera2.CameraManager#openCamera is no longer valid, or the camera service has shut down the connection due to a higher-priority access request for the camera device.

Value: 2

CAMERA_ERROR

Added in API level 21
static val CAMERA_ERROR: Int

The camera device is currently in the error state.

The camera has failed to open or has failed at a later time as a result of some non-user interaction. Refer to CameraDevice.StateCallback#onError for the exact nature of the error.

No further calls to the camera will succeed. Clean up the camera with CameraDevice#close and try handling the error in order to successfully re-open the camera.

Value: 3

CAMERA_IN_USE

Added in API level 23
static val CAMERA_IN_USE: Int

The camera device is in use already.

Value: 4

MAX_CAMERAS_IN_USE

Added in API level 23
static val MAX_CAMERAS_IN_USE: Int

The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened or torch mode cannot be turned on until previous instances are closed.

Value: 5

Public constructors

Public methods