catch exceptions thrown at trying to zoom manually

This commit is contained in:
tibbi 2017-11-21 13:49:07 +01:00
parent 3295e58306
commit b18f0cc4a3
1 changed files with 4 additions and 1 deletions

View File

@ -248,7 +248,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
newZoomFactor = Math.max(newZoomFactor, 0)
newZoomFactor = Math.min(mMaxZoom, newZoomFactor)
mParameters!!.zoom = newZoomFactor
try {
mParameters!!.zoom = newZoomFactor
} catch (ignored: Exception) {
}
mCamera?.parameters = mParameters
return true
}