开发者

How can I query the number of album in gallery

开发者 https://www.devze.com 2022-12-26 13:21 出处:网络
In android 2.1 sdk, how can I query the number and the name of each album开发者_开发知识库 in the 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

精彩评论

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

关注公众号