Camera.Lock Method

Definition

Caution

deprecated

Re-locks the camera to prevent other processes from accessing it.

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

Exceptions

if the camera cannot be re-locked (for example, if the camera is still in use by another process).

Remarks

Re-locks the camera to prevent other processes from accessing it. Camera objects are locked by default unless #unlock() is called. Normally #reconnect() is used instead.

Since API level 14, camera is automatically locked for applications in android.media.MediaRecorder#start(). Applications can use the camera (ex: zoom) after recording starts. There is no need to call this after recording starts or stops.

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

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

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