问题
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