0

I am trying to load an image with UniversalImageLoader. I tried this way:

String path = "/storage/emulated/0/BlackHole/Black Hole/1gatopan0000.png"

ImageLoader.getInstance().displayImage(path, viewHolder.imageView); 

But nothing happened. Is it possible to load the image using UniversalImageLoader with the path of the image as a string?

Sharjeel
  • 15,588
  • 14
  • 58
  • 89
Gilberto Ibarra
  • 2,849
  • 2
  • 27
  • 38

2 Answers2

1

Firstly, you have to add a backslash before any space character in your path.

String path = "/storage/emulated/0/BlackHole/Black\ Hole/1gatopan0000.png"

Then, Picasso is a great library that allows you to load images easily. I personally find it prettier than the UIL. In order to load an image into your ImageView, you simply have to :

Picasso.with(context).load("/your/path/here").into(yourImageView);
Karim Kouznetsov
  • 513
  • 1
  • 3
  • 13
0

Try this:

String path = "/storage/emulated/0/BlackHole/Black\ Hole/1gatopan0000.png"
EgorD
  • 886
  • 6
  • 12