[問題] 開發網路連線
我正在嘗試下載的功能
有看了書和網路上的文章
因為市面上很少3.0以上的書,但我開發以3.2為主
遇到一個奇怪的問題
以下這段code
(path是string的網址)
if(URLUtil.isNetworkUrl(path)){
try {
URL u=new URL(path);
URLConnection c=u.openConnection();
c.connect();//3.0以上會死在這裡
InputStream is=c.getInputStream();
is.close();
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
在3.0以上版本的系統執行會造成程式錯誤
在2.x版本就沒問題
有人可以幫我解答嗎??
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.121.192.16
※ 編輯: ymygarfield 來自: 122.121.192.16 (10/10 02:06)
→
10/10 09:29, , 1F
10/10 09:29, 1F
→
10/10 13:06, , 2F
10/10 13:06, 2F
推
10/10 14:18, , 3F
10/10 14:18, 3F
→
10/10 14:18, , 4F
10/10 14:18, 4F
→
10/10 16:05, , 5F
10/10 16:05, 5F
→
10/10 16:07, , 6F
10/10 16:07, 6F
討論串 (同標題文章)