Reputation: 42642
I realize
will create 2 files (image and thumbnail)
How can I delete both created images?
Upvotes: 4
Views: 1774
Reputation: 209
use this command using the id of the images you wish to delete:
mediaStoreIds.add(mediaStoreId);
context.getContentResolver().delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, BaseColumns._ID + "=?", new String[]{Long.toString(mediaStoreIds.get(id))});
and the following to delete the thumbnails:
mediaStoreIds.add(mediaStoreId);
context.getContentResolver().delete(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, BaseColumns._ID + "=?", new String[]{Long.toString(mediaStoreIds.get(id))});
Upvotes: 1