Is it true that the WebView will perform an Http Get and download the complete file then it calls calls my onDownloadStart() method and my code downloads the file ag
Its better when a beginn with the answer to your 3. question:
I think WebView uses GET-method for all Ressources. And only after it gets the first http Headers of this request WebView checks if there are headers that tell "do a download"
(e.g. headers like Content-Disposition: Attachment; filename=example.html
)
If no header exists which points to a download, WebView will display load and the content in its view.
onDownload
is called if there is a download header (even if its value are set to "inline").
Answer to question 2:
I think in that case the webview does NOT load the content of the content. Currently i don`t know a way to reuse the existing request.
Answer to question 4
If you overide shouldInterceptRequest
like in this example: https://stackoverflow.com/a/29811280/2377961 You could change this behavoir.