Hi all, I'm trying to get an image to display from an internet source
but nothing it coming up on my screen. After the button click which
calls the code I am presented with a blank screen. The code I'm using
is:
try {
URL url = new URL("http://code.google.com/android/
images/logo_android.gif");
URLConnection conn = url.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream
(is);
Bitmap bm = BitmapFactory.decodeStream(bis);
bis.close();
is.close();
ImageView image = (ImageView)findViewById
(R.id.timetableImage);
setContentView(R.layout.timetable);
image.setImageBitmap(bm);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Can any one see what's wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---