Convert String to Uri

前端 未结 6 1594
余生分开走
余生分开走 2020-11-30 19:58

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

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

myUri = ???;

6条回答
  •  醉话见心
    2020-11-30 20:37

    You can use the parse static method from Uri

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

提交回复
热议问题