当前位置:编程学习 > wap >>

Android网络通信的小问题

求大神帮忙!!!
String data="";
String urel="http://java.sun.com";
URL url=new URL(urel);
HttpURLConnection conn=(HttpURLConnection) url.openConnection();
InputStreamReader in=new InputStreamReader(conn.getInputStream());
BufferedReader buff=new BufferedReader(in);
String line=null;;
while((line=buff.readLine())!=null){
data+=line+"\n";
}
buff.close();
in.close();
conn.disconnect();
txt.setText(data);
里面的权限也添加进去,可是不能读到数据。
为什么没有任何的反应???
如何能够从网页中读取数据???
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,