Alex Rivera | Logout

Convert String to Uri

Asked 2010-08-15T12:42:32.640
262

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

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

myUri = ???;

Edit
Report

1 Answer

1

What are you going to do with the URI?

If you're just going to use it with an HttpGet for example, you can just use the string directly when creating the HttpGet instance.

HttpGet get = new HttpGet("http://stackoverflow.com");
answered 2010-08-15T13:30:54.417

Your Answer