Intent Action_View for image opens gallery with no delete option

天涯浪子 提交于 2019-12-23 03:39:19

问题


In my app the user can capture images and I populate a grid layout to display thumbnails. On clicking the thumbnail I would like the user to see the full image and have an option of deleting it if they want to. This is the code for the onItemClickListener for the grid layout:

layout_photos.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            final PhotoItem item = (PhotoItem) layout_photos.getItemAtPosition(position);
            String file_uri = item.getFILE_URI();

            Intent intent = new Intent();
            intent.setAction(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.parse(file_uri), "image/*");
            startActivityForResult(intent, IMAGE_VIEW_REQUEST_CODE);

        }
    });

Now this opens the gallery and I can see the full image but there is no delete option, only share option is there.

Is there any way I can get a delete option when I see this image.

来源:https://stackoverflow.com/questions/36735344/intent-action-view-for-image-opens-gallery-with-no-delete-option

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