catch exceptions thrown at setting camera parameters

This commit is contained in:
tibbi 2018-03-31 23:11:12 +02:00
parent 4e168fa1aa
commit dccc85e0a1
1 changed files with 2 additions and 2 deletions

View File

@ -411,12 +411,12 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
return@autoFocus return@autoFocus
} }
camera.cancelAutoFocus() mCamera!!.cancelAutoFocus()
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) { if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) {
mParameters!!.focusMode = Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE mParameters!!.focusMode = Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE
} }
camera.parameters = mParameters updateCameraParameters()
if (takePictureAfter) { if (takePictureAfter) {
takePicture() takePicture()