In my web view, I have this code. When I'm clicking a link in my web view application stops nd shows try again to open app.
myWebView.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent, String
contentDisposition, String mimetype, long contentLength) {
DownloadManager.Request request = new
DownloadManager.Request(Uri.parse(url));
CookieManager cookieManager = CookieManager.getInstance();
String cookie =
cookieManager.getCookie("https://learntatatrusts.org/");
request.addRequestHeader("Cookie", cookie);
request.allowScanningByMediaScanner();
Environment.getExternalStorageDirectory();
getApplicationContext().getFilesDir().getPath();
request.setNotificationVisibility(DownloadManager.Request.
VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalPublicDir(Environment.
DIRECTORY_DOWNLOADS, "download");
DownloadManager dm = (DownloadManager)
getSystemService(DOWNLOAD_SERVICE);
dm.enqueue(request);
}
});