mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-04-05 19:21:05 +02:00
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)
|
mParameters!!.setPreviewSize(mPreviewSize!!.width, mPreviewSize!!.height)
|
||||||
mCamera!!.parameters = mParameters
|
mCamera!!.parameters = mParameters
|
||||||
mCamera!!.startPreview()
|
try {
|
||||||
|
mCamera!!.startPreview()
|
||||||
|
} catch (ignored: RuntimeException) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user