Convert String to Uri
If you are using Kotlin and Kotlin android extensions, then there is a beautiful way of doing this.
val uri = myUriString.toUri()
To add Kotlin extensions (KTX) to your project add the following to your app module's build.gradle
repositories { google()}dependencies { implementation 'androidx.core:core-ktx:1.0.0-rc01'}