release Camera - Android android.hardware

Android examples for android.hardware:Close Camera

Description

release Camera

Demo Code

import android.hardware.Camera;

public class Main{

    private static Camera sOpenedCamera = null;
    private static Object sAccesLock = new Object();
    public static void releaseCamera() {
        synchronized (sAccesLock) {
            if (sOpenedCamera != null) {
                sOpenedCamera.release();
                sOpenedCamera = null;//from   ww w  .j  a v  a2 s . com
            }
        }
    }

}

Related Tutorials