M
M
mrgrigo2019-01-17 15:00:13
Java
mrgrigo, 2019-01-17 15:00:13

How to set image in ImageView from image resources?

Hello.
There are some image resources that come from the server side in a Base64 string.
Actually, the question is this: how can the decoded string (image resource (not the address, but the resource, the source - whatever)) be displayed in the ImageView as an image?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
illuzor, 2019-01-17
@mrgrigo

1) Cast a base64 string into a byte array using the Base64 class.
2) Decode this byte array into a Bitmap via BitmapFactory.
3) Display bitmap in ImageView.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question