Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// TakePicture Contract Registration
private val takePicture = registerForActivityResult(ActivityResultContracts.TakePicture()) {bitmap ->
bitmap?.let {
imageView.setImageBitmap(bitmap)
}
}
// Calling the takePicture contract
captureButton.setOnClickListener {
var imageUri: Uri? = null
takePicture(imageUri)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.