Issue
I have an application that launches a webivew. When I click on the PDF links in the webview, download of that PDF should start. I am able to do this with the following code.
view.getContext().startActivity(
new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
Here the moment the download starts my current webview activity is closed, as I give startActivity().
But I want user to be on the webview itself and download should start in the background without vanishing the webview. What is the way around for that? Kindly help.
Solution
You can do one thing. The moment the PDF download starts, then see to it that your webview activity is prevented from onDestroy() or finish().
Then u can start the download in background and also retain the Webview activity.
Answered By - EnthuDeveloper
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.