Reputation: 600
I have downloaded the images in a folder on my phone and I also have the path to those images. How can I load all the images from that folder in a gridView using Picasso library?
UPDATE:
GridView gridView = (GridView)findViewById(R.id.gridView);
File file = new File(Environment.getExternalStorageDirectory().getPath() +"/Gallery/Mix/");
Uri uri = Uri.fromFile(file);
Now what is the next step, how can I load all the files from Mix folder to gridView?
Upvotes: 0
Views: 816
Reputation: 4086
You should follow the documentation here. It walks you through adding ImageViews to a GridView.
Then instead of using mThumbIds
as your list of resource ids you can use File[] filesArray = new file.listFiles();
as your list of image files and loop through it instead.
Then replace the line imageView.setImageResource(mThumbIds[position]);
in ImageAdapter
with Picasso.with(context).load(filesArray[position]).into(imageView);
to use Picasso (got from here).
Upvotes: 1