我使用的网格视图使用XML解析显示图像,我得到了一些例外,如 java.lang.IllegalArgumentException:如果非法字符路径索引80:https://m.xsw88.com/allimgs/daicuo/20230912/388.png.jpg
,如何解决这个问题呢?我想显示所有类型的网址,有人知道请给样品code对我来说..
I am using grid view for displaying image using xml parsing,i got some exception like java.lang.IllegalArgumentException: Illegal character in path at index 80: https://m.xsw88.com/allimgs/daicuo/20230912/389.png.jpg
,how to solve this problem?,i want to display all kind of url,anybody knows please give sample code for me..
感谢所有
URL编码在Android上相同的方式完成在Java SE;
URL encoding is done in the same way on android as in Java SE;
try {
String url = "http://www.example.com/?id=123&art=abc";
String encodedurl = URLEncoder.encode(url,"UTF-8");
Log.d("TEST", encodedurl);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}