开发者

Using the built-in honeycomb gallery app to display application specific images

开发者 https://www.devze.com 2023-03-24 01:09 出处:网络
I would like to use the built-in gallery application to display images stored in an application specific folder - images stored in the folder returned by the getExternalFilesDir() method.There\'s plen

I would like to use the built-in gallery application to display images stored in an application specific folder - images stored in the folder returned by the getExternalFilesDir() method. There's plenty of code similar to the following that displays all images, but I need to display images stored in a specific folder:

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, TEST_RESULT);

An answer to a similar question referenced this solution:

Get/pick an image from Android's built-in Gallery app programmatically

However开发者_如何学运维, I do not want the user to pick a photo, but rather just display them. One answer referred to the calling intent.setType with "file:///sdcard/image/*".

However, this did not appear to work for anyone in the responses and it did not work for me either (I tried various things like "file://" + getExternalFilesDir() + "/*", etc...). Has anyone had any luck invoking the gallery app for a specific folder?

0

精彩评论

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