Can someone explain me how I would be able to imitate the default browser when trying to download .apk from the net?
So far I have this:
WebView webview;
@Override
public void onCreate(Bundle icicle)
        {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        webview =开发者_运维问答 (WebView) findViewById(R.id.webview);
        webview.setWebViewClient(new HelloWebViewClient());
        WebSettings webSettings = webview.getSettings();
        webSettings.setSavePassword(false);
        webSettings.setSaveFormData(false);
        webSettings.setJavaScriptEnabled(true);
        webSettings.setSupportZoom(false);
        webview.setDownloadListener(new DownloadListener() {
            public void onDownloadStart(final String url, String userAgent,
            String contentDisposition, String mimetype,
            long contentLength) {
            Toast.makeText(testapp.this, url, Toast.LENGTH_LONG);
            }
            });
        webview.loadUrl("http://dacp.jsharkey.org/TunesRemote-r2.apk");       
        }
I've already added the permission to use the internet. Are there any other permissions that I need to add? Am I doing the DownloadListener incorrectly?
Thank you in advance!
Use an Intent
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://dacp.jsharkey.org/TunesRemote-r2.apk"));
startActivity(intent);    
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论