I am using the Gallery3D-Code but want it to only display images from a sub-folder on the SD, not all of the images that are stored on it. To do this, I tried to change
public static final Uri STORAGE_URI = Images.Media.EXTERNAL_CONTENT_URI;
to
public static final Uri STORAGE_URI = Uri.fromFile(new File(ROOT_DIR));,
where
String ROOT_DIR = Environment.getExternalStorageDirectory().toString() + "/mySubDirectory";
but I guess this is transforming a content://-Uri to a file://-Uri and this may be a problem?
In any case, it doesn’t work :-(! Instead of just showing images from the ROOT_DIR-directory and its sub-directories, it shows no images at all (“Gallery empty”). Could anyone point me in the right direction as to what I am doing wrong?
I’ve also (later) asked this question on the Android Developer Google Group and the consensus there was that with the current structure of the Gallery3D code, my goal isn’t possible and I would have to change the images-source to a (custom) database in which my image-paths are stored.