Turning a string into a Uri in Android
Uri myUri = Uri.parse("http://www.google.com");
Here's the doc http://developer.android.com/reference/android/net/Uri.html#parse%28java.lang.String%29
The String I had to convert to a URI was a local file path, but without the file://
prefix. So even
Uri.parse(Uri.decode(STRING));
resulted in FileNotFoundException: No content provider
(see also this question).I got a valid URI by first creating a File
object i.e.:
Uri myUri = Uri.fromFile(new File(STRING));