如何在网络视图中实现Google驱动器文件的下载功能?

问题描述

您好,我正在开发一个应用程序,其中提供了Google驱动器链接,因此用户可以从那里下载文件,但是单击驱动器文件上的“下载”按钮即开始下载文件,但是没有任何下载发生。在这里,我使用此代码进行检查,但任何吐司都不起作用,请帮助

mWebView.setDownloadListener(new DownloadListener() {
        @Override
        public void onDownloadStart(String url,String userAgent,String contentdisposition,String mimetype,long contentLength) {
            DownloadManager.Request myRequest = new DownloadManager.Request(Uri.parse(url));
            myRequest.allowScanningByMediaScanner();
            myRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
            DownloadManager myManager = (DownloadManager)getSystemService(DOWNLOAD_SERVICE);
            myManager.enqueue(myRequest);

            Toast.makeText(BPhOneWeb.this,"Downloadig started",Toast.LENGTH_SHORT);

        }
    });

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)