jasonelle-archive / jasonelle-v2

🛸 🏘️ Jasonelle issues, releases, discussions and wiki repository.
https://jasonelle.com
Mozilla Public License 2.0
422 stars 58 forks source link

File Download does not work (Advanced Web View) #112

Open vsatmydynipnet opened 3 years ago

vsatmydynipnet commented 3 years ago

I try to get downloads working since days, but unsuccessful. Have to admit, I am no dev, so double hard. For me it looks like some parts of the implementation

https://github.com/delight-im/Android-AdvancedWebView

Downloads are handled automatically and can be listened to

@Override
public void onDownloadRequested(String url, String suggestedFilename, String mimeType, long contentLength, String contentDisposition, String userAgent) {
    // some file is available for download
    // either handle the download yourself or use the code below

    if (AdvancedWebView.handleDownload(this, url, suggestedFilename)) {
        // download successfully handled
    }
    else {
        // download couldn't be handled because user has disabled download manager app on the device
        // TODO show some notice to the user
    }
}

but I am not good enough in Java to be able to chang/add it myself.

Any hint would be greatly appreciated.