How can I request the number of albums in the gallery

In android 2.1 sdk, how can I request the number and name of each album in the gallery? And is there a way to trigger the intention of allowing the user to see all the photos of a particular album in the gallery?

Thank.

+3
source share
1 answer

To implement this yourself, you can call:

getExternalStorageDirectory ();

This will return you the SD card directory used in the Gallery. This is a file, iteratively searching for this file using listFiles () and isDirectory (); will give you a list of your desired albums.

An example of mutual file / folder search is here: (overkill)

Iterative file search

0
source

Source: https://habr.com/ru/post/1740113/


All Articles