Replace a text with an image

Asked

Viewed 51 times

0

I wonder if it would be possible to give replace of a piece of text by an image that is made through URL?

I want to replace image 1, image 2 and image 3 with images that are in a JSON array , what is in the JSON array is only the image URL.

A print of my apk:

inserir a descrição da imagem aqui

1 answer

1

Yes you can do it like this:

URL url = new URL("http://www.site.pt/url_da_imagem");
Bitmap bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageView.setImageBitmap(bmp);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.