From 8ae6c3220602057f881496f5b5cad4797ad76aba Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 6 Jun 2018 22:28:14 +0200 Subject: [PATCH] use a background thread for restarting the camera after recording --- .../com/simplemobiletools/camera/views/PreviewCameraTwo.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt index 99183921..e101e19e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt @@ -746,8 +746,10 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie mIsRecording = false mMediaRecorder!!.stop() mMediaRecorder!!.reset() - closeCamera() - openCamera(mTextureView.width, mTextureView.height) + Thread { + closeCamera() + openCamera(mTextureView.width, mTextureView.height) + }.start() mActivity.setRecordingState(false) }