Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save husaynhakeem/c269f19a079ce5300db50666050043d9 to your computer and use it in GitHub Desktop.
Save husaynhakeem/c269f19a079ce5300db50666050043d9 to your computer and use it in GitHub Desktop.
// Set up the CameraController
val cameraController = LifecycleCameraController(context)
cameraController.bindToLifecycle(lifecycleOwner)
// Attach the CameraController to PreviewView
val previewView = findViewById(R.id.preview_view)
previewView.setController(cameraController)
// Use the CameraController
cameraController.takePicture(…)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment