Android: How to save html file with user filled out form

前端 未结 1 370
-上瘾入骨i
-上瘾入骨i 2021-01-23 13:31

I was able to download this form to my sdcard (from a given URL): \"enter

My app can acces

相关标签:
1条回答
  • 2021-01-23 14:25

    If you want to store the data locally, you should implement this form as a widget-based Activity rather than using a WebView.

    If these values should be processed by a server, submit it like any other HTML form and let the server pick the values from the HTTP POST request.

    EDIT

    It is possible to attach a WebViewClient to the WebView, to allow methods in the WebView's Activity to be called from JavaScript. See sample code.

    Your HTML file would need to contain JavaScript that runs when the "Submit" button is clicked, collects the contents of the form and then passes it to the WebViewClient.

    (There might be an even easier way, see: Android Calling JavaScript functions in WebView)

    0 讨论(0)
提交回复
热议问题