Only take one picture

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

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