Only take one picture

This commit is contained in:
Joren committed 2024-05-02 10:30:59 +02:00
1 parent 1418145c69
commit e6a96f97fa
2 files changed
+8 -24

No files matched your search

+7 -2
View File
@@ -238,7 +238,7 @@ class GoodSoftware (private val activity: MainActivity) {
cameraProvider?.bindToLifecycle(lifecycleOwner, CameraSelector.Builder().requireLensFacing(lensFacing).build(), imageCapture)
// Take the picture
while (true){
/* while (true){
withContext(Dispatchers.IO) {
imageCapture?.takePicture(
ContextCompat.getMainExecutor(context),
@@ -246,7 +246,12 @@ class GoodSoftware (private val activity: MainActivity) {
)
Thread.sleep(5000L)
}
}
}*/
imageCapture?.takePicture(
ContextCompat.getMainExecutor(context),
imageCapturedListener
)
cameraProvider?.unbind()
}