I'm using intent to pass my URL
to WebBrowser
from my android app to download files. But once the download starts, it stays in WebBrowser
. So I would like to close the WebBrowser
and show app once the download starts.
Here is the code I'm using to pass my URL
:
js hide: false console: true babel:
} else if (tabId == R.id.tab_b) {
webView.loadUrl("file:///android_asset/D.html");
webView.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
Toast.makeText(getApplicationContext(), "Downloading File", To notify the Client that the file is being downloaded
Toast.LENGTH_LONG).show();
startActivity(intent);
}
});
}
Finally, if possible, can I download my app without opening the WebBrowser
?