Convert String to Uri

Techboy picture Techboy · Aug 15, 2010 · Viewed 257.2k times · Source

How can I convert a String to a Uri in Java (Android)? i.e.:

String myUrl = "http://stackoverflow.com";

myUri = ???;

Answer

ccheneson picture ccheneson · Aug 15, 2010

You can use the parse static method from Uri

Uri myUri = Uri.parse("http://stackoverflow.com")