【发布时间】:2015-11-09 23:02:01
【问题描述】:
我正在尝试运行一个返回 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());
【问题讨论】:
标签: java xml wifi filenotfoundexception 3g-network