Skip to content

Instantly share code, notes, and snippets.

Last active Aug 8, 2020
What would you like to do?
Smile, it’s CameraX! [preview and capture] | Preview - step 4: create an instance of the ProcessCameraProvider
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