try {
URL url = null;
url = new URL(url_string);
URLConnection conn = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line="";
while((line = reader.readLine())!=null){
Log.d("html",line);
}
} catch (Exception e) {
Log.d("Exception Error: ",e.toString());
}
我只是在阅读网站,但我遇到了 android.os.networkonmainthreadexception 错误
我的代码很简单..请看一下并告诉我我需要做什么..
谢谢,