1

Android デバイス用のすべてをダウンロードするアプリを開発していますが、いくつかの URL で、何らかの理由で FileNotFoundException がスローされて問題が発生しています。URL を印刷してブラウザにコピーすると、ブラウザで正常に動作するので、何が問題なのかわかりません。

例外:

W/System.err(14261): java.io.FileNotFoundException: 
http://feedproxy.google.com/~r/BillBurr/~5/pCkxUgHf5tY/MMPC_9-9-12.mp3

コード (ほとんどの例外処理を除く):

URL u = new URL(uri);

HttpURLConnection c = (HttpURLConnection) u.openConnection();
c.setRequestMethod("GET");
c.setDoOutput(true);
c.connect();
c.setReadTimeout(readTimeout);

int totalSize = c.getContentLength();
InputStream in = null;
try {
     in = c.getInputStream(); // Exception problem here 

     byte[] buffer = new byte[1024];
     int len1 = 0;
     ................
4

1 に答える 1

2

単に削除しc.setDoOutput(true);ます。ああ!

ハリズムに乾杯。

于 2012-09-19T21:47:49.577 に答える