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;
................