(Android)如何从webview下载https文件或dropbox文件?

时间:2014-12-12 03:32:21

标签: android webview

我想在Dropbox中下载该文件。 当我点击Dropbox页面中的下载按钮时。

www.dropbox.com/s/gcvehjeeg0qexzk/kjh.autohousing-2.apk?dl=0

然后转到以下网址

https://dl.dropboxusercontent.com/content_link/apQGcKRHO0O6WmD5wf7y3BH4SPjYxaV3CkY2FTvAAfvQveLFh6dAxDbDWnyUKjjx?dl=1

URL url = new URL(url);
HttpsURLConnection connection = url.openConnection();
InputStream is = connection.getInputStream();

但是,下载时会出现错误。

  

12-12 12:41:24.432:W / System.err(7917):java.io.FileNotFoundException:   https://dl.dropboxusercontent.com/content_link/SVmfYhZSFOofGnp76crtCXFDWSywjA4HYCPaZhhqPlPjZH9mZMIfV3B9jcWRxC3H?dl=1   12-12 12:41:24.442:W / System.err(7917):at   libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:177)   12-12 12:41:24.442:W / System.err(7917):at   libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:270)   12-12 12:41:24.442:W / System.err(7917):at   java.net.URL.openStream(URL.java:462)

获取输入流时。我得到了错误日志。 问题是什么?

0 个答案:

没有答案