use a background thread for restarting the camera after recording

This commit is contained in:
tibbi 2018-06-06 22:28:14 +02:00
parent 6c885c83c2
commit 8ae6c32206
1 changed files with 4 additions and 2 deletions

View File

@ -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)
}