How to post data for WebView android

后端 未结 5 1336
挽巷
挽巷 2020-12-25 12:29

I need to post data to Webview.
I found from some of the links the below code:

 WebView webview = new WebView(this);
 setContentView(webview);
 String u         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-25 12:50

    This is a simple workaround.

    String html = "" +
        "" +
        "" +
        "
    " + "
    " + "
    " + "
    " + "" + ""; webview.loadData(html, "text/html", "UTF-8");

    I know this is not the best method but this works.

提交回复
热议问题