mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-04-23 19:57:24 +02:00
make sure the camera is not null when setting up the preview after measuring
This commit is contained in:
parent
28bb406d42
commit
c1ea435343
@ -462,12 +462,14 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mSetupPreviewAfterMeasure) {
|
if (mSetupPreviewAfterMeasure) {
|
||||||
|
if (mCamera != null) {
|
||||||
mSetupPreviewAfterMeasure = false
|
mSetupPreviewAfterMeasure = false
|
||||||
mCamera?.stopPreview()
|
mCamera!!.stopPreview()
|
||||||
setupPreview()
|
setupPreview()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun enableFlash() {
|
fun enableFlash() {
|
||||||
mParameters!!.flashMode = Camera.Parameters.FLASH_MODE_TORCH
|
mParameters!!.flashMode = Camera.Parameters.FLASH_MODE_TORCH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user