mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
catch exceptions thrown by takePicture
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user