How can I convert a String to a Uri in Java (Android)? i.e.:
String myUrl = "http://stackoverflow.com";
myUri = ???;
How can I convert a String to a Uri in Java (Android)? i.e.:
String myUrl = "http://stackoverflow.com";
myUri = ???;
You can use the parse
static method from Uri
Uri myUri = Uri.parse("http://stackoverflow.com")
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");