java.lang.IllegalArgumentException: Illegal character in query at index 55

URL url;
URI uri=null;
try {
url = new URL(
String); // 把你需要的地址放在这里,此段代码会帮你编码
try {
uri = new URI(url.getProtocol(), url.getHost(), url
.getPath(), url.getQuery(), null);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

你可能感兴趣的:(android,原创)