Created
March 29, 2019 17:56
-
-
Save traendy/a6863a2c45e05c55227d6f888873e433 to your computer and use it in GitHub Desktop.
Override of onActivityResult for an REQUEST_IMAGE_CAPTURE intent.
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
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