forked from yesidlazaro/GmailBackground
-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
i'm using this code for getting asking user to choose which file he wants to upload
but i cannot know the way for getting the correct path from Uri to put it in .withattachment
can you told me how?
it's kotlin code
`
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == PICK_FROM_GALLERY && resultCode == RESULT_OK) {
imageUri = data?.data!!
}
}
private fun openFilePicker() {
val i = Intent(
Intent.ACTION_PICK,
MediaStore.Images.Media.EXTERNAL_CONTENT_URI
)
i.type = "image/*"
i.putExtra("return-data", true)
startActivityForResult(i, PICK_FROM_GALLERY)
}
`
Metadata
Metadata
Assignees
Labels
No labels