Possible Duplicate:
android.os.NetworkOnMainThreadException
I'm trying to build an RSS reader for android. Here is my code. I get error saying can't perform network operation on thread.
URL url = null;
try {
url = new URL((data.get(position).getThumbnail()));
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
InputStream content = null;
try {
content = (InputStream)url.getContent();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Drawable d = Drawable.createFromStream(content , "src");
Bitmap mIcon1 = null;
try {
mIcon1 =
BitmapFactory.decodeStream(url.openConnection().getInputStream());
} catch (IOException e) {
e.printStackTrace();
}
Details: API is 16 I'm using XP pro , SP3. Android os: Jelly Bean
Here is my logcat error: http://pastebin.com/9wyVpNHV