Android APIs
public static abstract class

CameraManager.AvailabilityListener

extends Object
java.lang.Object
   ↳ android.hardware.camera2.CameraManager.AvailabilityListener

Class Overview

A listener for camera devices becoming available or unavailable to open.

Cameras become available when they are no longer in use, or when a new removable camera is connected. They become unavailable when some application or service starts using a camera, or when a removable camera is disconnected.

Extend this listener and pass an instance of the subclass to addAvailabilityListener(CameraManager.AvailabilityListener, Handler) to be notified of such availability changes.

Summary

Public Constructors
CameraManager.AvailabilityListener()
Public Methods
void onCameraAvailable(String cameraId)
A new camera has become available to use.
void onCameraUnavailable(String cameraId)
A previously-available camera has become unavailable for use.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CameraManager.AvailabilityListener ()

Public Methods

public void onCameraAvailable (String cameraId)

A new camera has become available to use.

The default implementation of this method does nothing.

Parameters
cameraId The unique identifier of the new camera.

public void onCameraUnavailable (String cameraId)

A previously-available camera has become unavailable for use.

If an application had an active CameraDevice instance for the now-disconnected camera, that application will receive a disconnection error.

The default implementation of this method does nothing.

Parameters
cameraId The unique identifier of the disconnected camera.