开发者

How can I query the number of album in gallery

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜