mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-04-12 06:31:15 +02:00
handle picture taking on a background thread
This commit is contained in:
parent
103fc0cbb1
commit
2023cdca50
@ -296,6 +296,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||||||
isWaitingForTakePictureCallback = true
|
isWaitingForTakePictureCallback = true
|
||||||
mIsPreviewShown = true
|
mIsPreviewShown = true
|
||||||
try {
|
try {
|
||||||
|
Thread {
|
||||||
mCamera!!.takePicture(null, null, takePictureCallback)
|
mCamera!!.takePicture(null, null, takePictureCallback)
|
||||||
|
|
||||||
if (config.isSoundEnabled) {
|
if (config.isSoundEnabled) {
|
||||||
@ -306,6 +307,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
|
|||||||
mp?.start()
|
mp?.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}.start()
|
||||||
} catch (ignored: Exception) {
|
} catch (ignored: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user