Skip to content
Snippets Groups Projects
Commit 934bda0f authored by Robert Stone's avatar Robert Stone Committed by Nicolas Pomepuy
Browse files

Add URI extension to remove query portion

parent 2f91c89c
No related branches found
No related tags found
1 merge request!1020Android Auto: Update play-from-here and library pagination
......@@ -9,7 +9,6 @@ import android.content.Context
import android.content.res.Resources
import android.net.ConnectivityManager
import android.net.Uri
import android.util.Log
import android.util.Patterns
import android.util.TypedValue
import android.view.View
......@@ -139,3 +138,14 @@ fun Uri?.retrieveParent(): Uri? {
}
return null
}
fun Uri?.removeQuery(): Uri? {
try {
if (this == null) return null
val builder = Uri.Builder().scheme(scheme).authority(authority)
pathSegments.forEach { builder.appendPath(it) }
return builder.build()
} catch (e: Exception) {
}
return null
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment