wrap startpreview in a try/catch block

This commit is contained in:
tibbi 2017-06-22 22:09:47 +02:00
parent 0d5fd22921
commit e77f211f07
1 changed files with 4 additions and 1 deletions

View File

@ -445,7 +445,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
mParameters!!.setPreviewSize(mPreviewSize!!.width, mPreviewSize!!.height)
mCamera!!.parameters = mParameters
try {
mCamera!!.startPreview()
} catch (ignored: RuntimeException) {
}
}
}