wrap startpreview in a try/catch block
This commit is contained in:
parent
0d5fd22921
commit
e77f211f07
|
@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue