I want to download the file using Webview
in Android, but sometimes it doesn't work.
For example, if we have a webpage and this page have a form
, when we submit this form some file will be download.If you set the form submit method to get
webview will call onDownloadStart()
method to download file,but if you set the form submit method to post
,webview will never call onDownloadStart()
method,at the same time logcat
print this warning.
Cannot call determinedVisibility() - never saw a connection for the pid:
Can't download:
<form id="form" method="post" action="/download">
<input type="hidden" id="fileName" name="fileName" value="Test.doc"/>
</form>
Can download:
<form id="form" method="get" action="/download">
<input type="hidden" id="fileName" name="fileName" value="Test.doc"/>
</form>
And also i did a test in different Android Version: Android 7.0 and Android 2.X,only Android 2.X can work correctly.
Can you help me solve this problem or give me a hint?