-
-
Save nikit19/4fb1d225affcde26147a37e9e3577df2 to your computer and use it in GitHub Desktop.
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?) { | |
super.onActivityResult(requestCode, resultCode, data) | |
if (resultCode == RESULT_OK) { | |
when (requestCode) { | |
REQUEST_CODE_SINGLE_SELECT -> { | |
val uri = data?.data | |
// Do stuff with uri | |
} | |
REQUEST_CODE_MULTI_SELECT -> { | |
var mediaCount = 0 | |
while (mediaCount < data?.clipData!!.itemCount) { | |
val uri = data.clipData!!.getItemAt(mediaCount).uri | |
// Do stuff with uri | |
mediaCount++ | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment