Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old November 15th, 2010, 11:22 AM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 17
 
Device(s): HTC Dream
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default Display image from the Internet with ImageView?

I have an image view object declared in the main class for my app

ImageView iv = new InageView;

I am able to view a picture in the res/drawable folder but when I use setImageUri method, nothing appears.

Advertisements
MIIISTER NEUGIT is offline  
Reply With Quote
sponsored links
Old November 18th, 2010, 12:16 AM   #2 (permalink)
Member
 
Join Date: Sep 2010
Posts: 123
 
Device(s): HTC EVO 4G
Carrier: Not Provided

Thanks: 4
Thanked 15 Times in 11 Posts
Default

I'm not sure exactly, but I get Drawables from the internet and set them in the ImageView using setImageDrawable. To get the drawable:

Quote:
URL url = new URL(address);
InputStream content = (InputStream)url.getContent();
Drawable d = Drawable.createFromStream(content , "src");
RazzleFnDazzle is offline  
Reply With Quote
Old November 18th, 2010, 07:07 PM   #3 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Nov 2010
Posts: 17
 
Device(s): HTC Dream
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by RazzleFnDazzle View Post
I'm not sure exactly, but I get Drawables from the internet and set them in the ImageView using setImageDrawable. To get the drawable:
Yea, I figured this out after I posted. Thanks anyway.
MIIISTER NEUGIT is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 01:29 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.