XML 形式を返す Web サービスを実行しようとしていますが、3G ネットワークで FileNotFoundException をスローすることがあり、WIFI ネットワークで正常に動作することがあります。
接続のコードは次のとおりです。
@Override
protected ArrayList<NewsItemVO> doInBackground(Void... args) {
try {
URLConnection conn = new URL(feedUrl).openConnection();
conn.setConnectTimeout(20000);
conn.setReadTimeout(20000);
InputStream in = new BufferedInputStream(conn.getInputStream());
}
}
これは例外をスローする行です
InputStream in = new BufferedInputStream(conn.getInputStream());