Last active
August 8, 2020 18:58
-
-
Save magdamiu/7c874eb756de4c085f27001d67322753 to your computer and use it in GitHub Desktop.
Smile, it’s CameraX! [preview and capture] | Preview - step 4: create an instance of the ProcessCameraProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val cameraProviderFuture = ProcessCameraProvider.getInstance(this) | |
// used to bind the lifecycle of camera to the lifecycle owner | |
val cameraProvider: ProcessCameraProvider = cameraProviderFuture.get() | |
// add a listener to the cameraProviderFuture | |
val cameraExecutor = ContextCompat.getMainExecutor(this) | |
cameraProviderFuture.addListener(Runnable {}, cameraExecutor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment