In android 2.1 sdk, how can I query the number and the name of each album开发者_开发知识库 in the gallery? And is there an way to launch an intent to allow user to see all pictures of a particular album in the gallery?
Thank you.
To implement this yourself you can call:
getExternalStorageDirectory();
This will return you the SD Card directory that is used in the Gallery. This is a file, an iterative search of this File using listFiles() and isDirectory(); will get you the list of albums you want.
An example of an interative file/folder finder is here: (overkill)
Iterative FileSearch
精彩评论