I\'m getting a Fail to connect to camera service exception when I run my Android app in the emulator. I\'ve read the various existing posts but none have fixed this. It is
If you periodically got a white screen instead your view of camera - use:
private void releaseCameraAndPreview() {
if (mCamera != null) {
mCamera.setPreviewCallback(null);
mCameraView.getHolder().removeCallback(mCameraView);
mCamera.release();
mCamera = null;
}
}
and put it here
try {
releaseCameraAndPreview();
mCamera = getCameraInstance();
}...
and here
@Override
protected void onPause() {
super.onPause();
releaseCameraAndPreview();
}