HTTP POST response into WebView in android

前端 未结 2 725
天涯浪人
天涯浪人 2020-12-06 13:17

I\'m attempting to connect to the page using an HTTP Post. I do an http post for creating a webview. i need to redirect to another page from the webview. But when the cont

2条回答
  •  再見小時候
    2020-12-06 13:39

    Use like this

    WebView webview = new WebView(this);
    setContentView(webview);
    byte[] post = EncodingUtils.getBytes("postvariable=value&nextvar=value2", "BASE64");
    webview.postUrl("http://www.geenie.nl/AnHeli/mobile/ranking/demo/index.php", post);
    

提交回复
热议问题