catch exceptions thrown by takePicture

This commit is contained in:
tibbi 2017-11-04 23:49:11 +01:00
parent bc2eb5e80d
commit 78949bb0a8
1 changed files with 10 additions and 7 deletions

View File

@ -283,6 +283,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
mCamera!!.parameters = mParameters
isWaitingForTakePictureCallback = true
mIsPreviewShown = true
try {
mCamera!!.takePicture(null, null, takePictureCallback)
if (config.isSoundEnabled) {
@ -293,6 +294,8 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
mp?.start()
}
}
} catch (ignored: Exception) {
}
}
mCanTakePicture = false
mIsFocusingBeforeCapture = false