다음을 통해 공유


Camera.Unlock Method

Definition

Caution

deprecated

Unlocks the camera to allow another process to access it.

[Android.Runtime.Register("unlock", "()V", "")]
[System.Obsolete("deprecated")]
public void Unlock ();
[<Android.Runtime.Register("unlock", "()V", "")>]
[<System.Obsolete("deprecated")>]
member this.Unlock : unit -> unit
Attributes

Exceptions

if the camera cannot be unlocked.

Remarks

Unlocks the camera to allow another process to access it. Normally, the camera is locked to the process with an active Camera object until #release() is called. To allow rapid handoff between processes, you can call this method to release the camera temporarily for another process to use; once the other process is done you can call #reconnect() to reclaim the camera.

This must be done before calling android.media.MediaRecorder#setCamera(Camera). This cannot be called after recording starts.

If you are not recording video, you probably do not need this method.

Java documentation for android.hardware.Camera.unlock().

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