Picasso Load image from filesystem

edrian picture edrian · May 15, 2014 · Viewed 84.6k times · Source

Can I use Picasso library to load images from the filesystem?

I'm using startActivityForResult to let the user pick a photo from his gallery, and then want to show the selected image.

I already have working code to get the image filesystem Uri, but can't get the Picasso.load() method to work.

Answer

Patrick Favre picture Patrick Favre · May 15, 2014

Of course you can. Its actually pretty straight forward:

File f = new File("path-to-file/file.png");

or

File f = new File(uri);

Picasso.get().load(f).into(imageView);

also

Picasso.get().load(uri).into(imageView);

works