0
웹에서 HTML을 가져오고 싶지만 할 수 없습니다. 여기 내 코드는안드로이드 웹에서 Html 가져 오기
final EditText et = (EditText) findViewById(R.id.editText1);
final TextView tv = (TextView) findViewById(R.id.textView1);
final Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
try {
URL url = null;
url = new URL(et.getText().toString());
URLConnection conn = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
tv.append(line);
}
} catch (Exception e) {
Log.e("error", "erorr connection "+ e.toString());
}
}
});
나는 또한 이미 인터넷에서 허가를 추가했다. 4.0.3
나는 – kongkea
http://stackoverflow.com/questions/6466719/manipulating-data-on-webs-in-android/6466749#6466749 – Rasel
솔루션 여기을 http 텍스트 뷰에 표시 할 웹에서 HTML을 얻고 싶은 : // stackoverflow.com/questions/12327625/error-when-get-html-from-web-in-android/12328074#12328074 –