Interface CefriumDownloadClient
Called on the UI thread. Decides and follows the downloads of a
CefriumBrowser, like android.webkit.DownloadListener with
control. Set it with CefriumBrowser.setDownloadClient(CefriumDownloadClient).
Without a client a download starts on its own and is saved in the app's own storage; from the next release it will be refused, as in WebView.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonBeforeDownload(CefriumBrowser browser, CefriumBrowser.DownloadItem item, CefriumBrowser.BeforeDownloadCallback callback) A download is about to start.default voidonDownloadUpdated(CefriumBrowser browser, CefriumBrowser.DownloadItem item) Progress of an allowed download;CefriumBrowser.DownloadItemalso cancels, pauses and resumes it.
-
Method Details
-
onBeforeDownload
void onBeforeDownload(CefriumBrowser browser, CefriumBrowser.DownloadItem item, CefriumBrowser.BeforeDownloadCallback callback) A download is about to start. Callcallback.allow(path)to save it (null: under its suggested name in the app's Downloads directory,Context.getExternalFilesDir(DIRECTORY_DOWNLOADS)) orcallback.cancel(); now or later (after asking the user), from any thread. Nothing is written until then. -
onDownloadUpdated
Progress of an allowed download;CefriumBrowser.DownloadItemalso cancels, pauses and resumes it.
-