show an error if Data returned from the camera after capturing a photo is empty

This commit is contained in:
tibbi 2018-02-26 16:15:02 +01:00
parent b65420cceb
commit 59da992442
1 changed files with 5 additions and 0 deletions

View File

@ -323,6 +323,11 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
}
private val takePictureCallback = Camera.PictureCallback { data, cam ->
if (data.isEmpty()) {
mActivity!!.toast(R.string.unknown_error_occurred)
return@PictureCallback
}
isWaitingForTakePictureCallback = false
if (!isImageCaptureIntent) {
handlePreview()