catch exceptions thrown by takePicture
This commit is contained in:
parent
bc2eb5e80d
commit
78949bb0a8
|
@ -283,6 +283,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||||
mCamera!!.parameters = mParameters
|
mCamera!!.parameters = mParameters
|
||||||
isWaitingForTakePictureCallback = true
|
isWaitingForTakePictureCallback = true
|
||||||
mIsPreviewShown = true
|
mIsPreviewShown = true
|
||||||
|
try {
|
||||||
mCamera!!.takePicture(null, null, takePictureCallback)
|
mCamera!!.takePicture(null, null, takePictureCallback)
|
||||||
|
|
||||||
if (config.isSoundEnabled) {
|
if (config.isSoundEnabled) {
|
||||||
|
@ -293,6 +294,8 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
||||||
mp?.start()
|
mp?.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (ignored: Exception) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mCanTakePicture = false
|
mCanTakePicture = false
|
||||||
mIsFocusingBeforeCapture = false
|
mIsFocusingBeforeCapture = false
|
||||||
|
|
Loading…
Reference in New Issue