IO Exception on invoking execute() method of HttpGet class
Posted
by
AndroidNoob
on Stack Overflow
See other posts from Stack Overflow
or by AndroidNoob
Published on 2010-12-25T15:44:19Z
Indexed on
2010/12/25
15:54 UTC
Read the original article
Hit count: 244
Why I'm getting IOException in this peace of code? Thanks.
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://www.google.com/");
HttpResponse response;
try {
response = httpclient.execute(httpget);
} catch (ClientProtocolException e) {
Toast.makeText(this, "ClientProtocolEx", Toast.LENGTH_LONG).show();
e.printStackTrace();
} catch (IOException e) {
Toast.makeText(this, "IOEx", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
© Stack Overflow or respective owner