Android image picker for local files only

扶醉桌前 提交于 2019-11-28 08:24:02

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);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!