我在WebView中通过URL加载了一个含有表单内容的html页面,在填写了表单内容之后点击页面中的提交按钮,
请问要如何能获得带有填写了数据的该html文件,该文件需要保存到本地?

解决方案 »

  1.   

    给你看看我的例子:                WebView webview;
    webview= (WebView) findViewById(R.id.webview);
    wvHelp.loadDataWithBaseURL(
    "file:///android_asset/",
    "<html><body >"
    + "<h2 align=\"center\">"+getResources().getString(R.string.adsstring)+"</h2>" + "<a href=\"#hints\"><font size=\"5\">"+getResources().getString(R.string.introductions)+"</font></a><br/>"
    + "<a name=\"hints\"></a>"
    + "<br><br><font size=\"5\">"+getResources().getString(R.string.introductions)+"</font></br>"
    + "<br><font size=\"4\">"
    + getResources().getString(R.string.feture1)
    + "</font></br>"
    + "<br><font size=\"4\">"
    + getResources().getString(R.string.feture2)
    + "</font><br>"
    + "<br><font size=\"4\">"
    + getResources().getString(R.string.feture3)
    + "</font><br>"
    + "<br><font size=\"4\">"
    + getResources().getString(R.string.feture4)
    + "</font><br>"

    + "</body></html>", mimeType, encoding, null);
              } 
      

  2.   

    不好意思输入有误
                    WebView webview;
            webview= (WebView) findViewById(R.id.webview);
            webview.loadDataWithBaseURL(
                    "file:///android_asset/",      //在asset里存放你html中要用到的图片等文件
                    "<html><body >"
                            + "<h2 align=\"center\">"+getResources().getString(R.string.adsstring)+"</h2>"                        + "<a href=\"#hints\"><font size=\"5\">"+getResources().getString(R.string.introductions)+"</font></a><br/>"
                            + "<a name=\"hints\"></a>"
                            + "<br><br><font size=\"5\">"+getResources().getString(R.string.introductions)+"</font></br>"
                            + "<br><font size=\"4\">"
                            + getResources().getString(R.string.feture1)
                            + "</font></br>"
                            + "<br><font size=\"4\">"
                            + getResources().getString(R.string.feture2)
                            + "</font><br>"
                            + "<br><font size=\"4\">"
                            + getResources().getString(R.string.feture3)
                            + "</font><br>"
                            + "<br><font size=\"4\">"
                            + getResources().getString(R.string.feture4)
                            + "</font><br>"
                        
                            + "</body></html>", mimeType, encoding, null);
                  } 
      

  3.   

    好像这样做不到,我加载的文件是一个已经写好的html文件模板,只是能在里面填东西...