I am new in android development.I have a PNG base64 local string image that stored in a variable and I want to show it on ImageView using Picasso.but picasso only get 'Resources, assets, files'.So How can I load My image?
Asked
Active
Viewed 1,346 times
0
-
"I have a base64 local string image" -- why is it base64-encoded? "So How can I load My image?" -- decode it first, then load it. – CommonsWare May 18 '19 at 14:05
-
how to decode it and load by picasso? – Mohammad Noori May 18 '19 at 14:06
-
You would decode it yourself. Picasso is not responsible for doing that. – CommonsWare May 18 '19 at 14:09
-
I know that.but how to decode it and then load it using picasso? – Mohammad Noori May 18 '19 at 14:11
-
You might wish to edit your question and provide much more details about the nature of your "base64 local string image". For example, what is the type of the image: PNG, JPEG, something else? Where is this "local string": a variable in memory, a file on the filesystem, something else? For example, if the answers are "PNG" and "a variable", you would not use Picasso, but instead use `BitmapFactory`: https://stackoverflow.com/q/4837110/115145 – CommonsWare May 18 '19 at 14:22
-
i have edited it – Mohammad Noori May 18 '19 at 14:26
-
You do not need Picasso. Use `BitmapFactory` to create a `Bitmap` to use in your `ImageView`. – CommonsWare May 18 '19 at 14:29
-
i want to avoid from memory leak.so as i searched picasso handle these kind of problems. – Mohammad Noori May 18 '19 at 14:44
-
Picasso has little to do with memory leaks. `BitmapFactory` also has little to do with memory leaks. – CommonsWare May 18 '19 at 15:07