Language

CameraDevice.CameraDeviceSetup.OpenCamera Method

Definition

Utility function to forward the call to CameraManager.openCamera(String,Executor,StateCallback).

[Android.Runtime.Register("openCamera", "(Ljava/util/concurrent/Executor;Landroid/hardware/camera2/CameraDevice$StateCallback;)V", "GetOpenCamera_Ljava_util_concurrent_Executor_Landroid_hardware_camera2_CameraDevice_StateCallback_Handler", ApiSince=35)]
public abstract void OpenCamera(Java.Util.Concurrent.IExecutor executor, Android.Hardware.Camera2.CameraDevice.StateCallback callback);
[<Android.Runtime.Register("openCamera", "(Ljava/util/concurrent/Executor;Landroid/hardware/camera2/CameraDevice$StateCallback;)V", "GetOpenCamera_Ljava_util_concurrent_Executor_Landroid_hardware_camera2_CameraDevice_StateCallback_Handler", ApiSince=35)>]
abstract member OpenCamera : Java.Util.Concurrent.IExecutor * Android.Hardware.Camera2.CameraDevice.StateCallback -> unit

Parameters

executor
IExecutor

The executor which will be used when invoking the callback. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

callback
CameraDevice.StateCallback

The callback which is invoked once the camera is opened. This value cannot be null.

Attributes

Remarks

Utility function to forward the call to CameraManager.openCamera(String,Executor,StateCallback). This function simply calls CameraManager.openCamera for the cameraId for which this class was constructed. All semantics are consistent with CameraManager.openCamera. Requires Manifest.permission.CAMERA

Android reference for android.hardware.camera2.CameraDevice.CameraDeviceSetup.openCamera.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to