Skip to content

Instantly share code, notes, and snippets.

@traendy
Created March 29, 2019 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save traendy/a6863a2c45e05c55227d6f888873e433 to your computer and use it in GitHub Desktop.
Save traendy/a6863a2c45e05c55227d6f888873e433 to your computer and use it in GitHub Desktop.
Override of onActivityResult for an REQUEST_IMAGE_CAPTURE intent.
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
val imageBitmap: Bitmap?
if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == Activity.RESULT_OK) {
imageBitmap = handleSamplingAndRotationBitmap(this, Uri.fromFile(File(currentPhotoPath)))
imageBitmap?.let {
imageView.setImageBitmap(it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment