Answer the question
In order to leave comments, you need to log in
How to remove the camera rotation after the intent to the photo?
I create an intent for the camera as follows:
class GetPhotoContract : ActivityResultContract<Unit, Uri>() {
private var imageUri: Uri? = null
override fun createIntent(context: Context, input: Unit?): Intent {
val values = ContentValues()
values.put(MediaStore.Images.Media.TITLE, PICTURE_TITLE)
values.put(MediaStore.Images.Media.DESCRIPTION, PICTURE_DESCRIPTION)
imageUri = context.contentResolver.insert(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
values
)
val cameraIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri)
return cameraIntent
}
override fun parseResult(resultCode: Int, intent: Intent?): Uri? {
return when {
resultCode != Activity.RESULT_OK -> null
else -> imageUri
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question