I'm using the built in Android image picker as follows:
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
m_activity.startActivityForResult(photoPickerIntent, PHOTO_PICKER_ID);
Is there any way to restrict this to show only locally available files. On my device it is currently picking up Picasa thumbnails and I'd like to exclude all images that are not actually present on the device.
Adding intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true); will allow for local files only. It will exclude picasa images. Hope this helps.
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
startActivityForResult(Intent.createChooser(intent,
"Complete action using"), PHOTO_PICKER_ID);
User this code to launch intent to get local image chooser.
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,
"Complete action using"), PHOTO_PICKER_ID);
来源:https://stackoverflow.com/questions/9080109/android-image-picker-for-local-files-only