I have a question about downloading files from Android Webview!

Asked 2 years ago, Updated 2 years ago, 19 views

I succeeded in downloading it from webview...

If you press down on your phone, on the screen you want to download,

Proceed to the main Internet window.

If you press Back, you'll be moved to the download location... <

This is the only code I've added.

mWebView.setDownloadListener (new DownloadListener()  {

            public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
                Intent i = new Intent(Intent.ACTION_VIEW);
                i.setData(Uri.parse(url));
                startActivity(i);
            }
        });

I just want to stop at the screen I downloaded. For help ^

^

For your information, if you download it on the web, you just download it from the window ~^

~^

android

2022-09-21 15:56

1 Answers

The onDownloadStart() function creates a screen transition because the code is written to display a new screen as startActivity(). Delete the above code and implement it by referring to the shouldOverrideUrlLoading() function in the following link.


2022-09-21 15:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.