I have done it, but it doesn't work.
my bitmap is always NULL :(
this is my code:
private Bitmap getRemoteImage(URL url) {
try {
URLConnection conn = url.openConnection();
conn.connect();
BufferedInputStream bis = new
BufferedInputStream(conn.getInputStream());
Bitmap bm = BitmapFactory.decodeStream(bis);
bis.close();
if(bm == null)
Log.d("DEBUG", "NULLLLLLLLLLLL");
return bm;
} catch (IOException e) {
Log.d("DEBUG", "Errore: Impossibile recuperare
l'immagine");
}
return null;
}
I have tried also with openStream(), but it's the same problem.
Please, help me. Thanks.
On 5 Mar, 05:46, Nithin <[email protected]> wrote:
> Convert the image from URL to Bitmap.
> Then use setImageBitmap().
>
> On Mar 5, 4:41 am, Paolo <[email protected]> wrote:
>
>
>
> > I have to insert, at runtime, an image in an ImageView.
> > I haven't it in local, but i can get it from an URL.
>
> > Anybody has an idea about how could I do itt?
--
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