启动传递#字符的调用时出现IllegalArgumentException

时间:2011-01-21 05:09:40

标签: android

我试图通过传递带有数字的'#'字符来发起呼叫。但是当我通过那个uri时,发生了一个异常,如下所示

01-21 10:36:21.247:WARN / System.err(383):java.lang.IllegalArgumentException:索引104处片段中的非法字符:

我的代码是

      public String getHttpConnectionToServer(String uri, String proxyIP,
               Integer port, String debugMode) {

         HttpGet httppost = new HttpGet(uri);
    HttpResponse response = client.execute(httppost);
    HttpEntity entity = response.getEntity();
    InputStream is = entity.getContent();
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        is, "iso-8859-1"), 8);

    StringBuilder sb = new StringBuilder();
}


Exception is thrown at this line of code : HttpGet httppost = new HttpGet(uri);

我该如何解决?请HElp

1 个答案:

答案 0 :(得分:1)