Code example for Camera

Methods: release

0
	} 
 
	@Override 
	protected void onPause() { 
		if (mCamera != null) {
			mCamera.release(); // release the camera for other applications
			mCamera = null;
		} 
		super.onPause(); 
	} 
 
	/** A safe way to get an instance of the Camera object. */ 
	public static Camera getCameraInstance() {
		Camera c = null;
		try { 
			c = Camera.open(); // attempt to get a Camera instance
		} catch (Exception e) {
			// Camera is not available (in use or does not exist) 
		} 
		return c; // returns null if camera is unavailable
	}