Only take one picture
This commit is contained in:
		@@ -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()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user