URL with parameter in WebView not working in Android?

前端 未结 8 1477
南笙
南笙 2020-12-20 14:40

I am trying to call the loadUrl method in a webview with the below url

http://stage.realtylog.net/iPhone/functions.php?username=xxx&ID=xxx&act=readFileAndPri

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 15:18

    change your url to:

    StringBuffer buffer=new StringBuffer("http://stage.realtylog.net/iPhone/functions.php");
    buffer.append("?username="+URLEncoder.encode("xxxxxxx"));
    buffer.append("&id="+URLEncoder.encode("xxxxxxxx"));
    buffer.append("act="+URLEncoder.encode("readFileAndPrint"));
    webView.loadUrl(buffer.toString());
    

提交回复
热议问题