How can I delete all 0 kb / null files from SD card in specific folder or from DCIM /camera/thumnail or from subfolder too.
In my case I deleted last pic from my device inside capture and put the pic only in my app pic. as per my code its working fine in some device but in HTC ONE M7 it show black thumb in device gallery and when I find the location of the pic it show me DCIM/camera but the pic size i get 0kb and image resolution is -1x-1. so is there any solution that I can delete all pic with size 0kb from DCIM folder...
this is my code
Cursor c = null;
Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
getContentResolver().delete(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
BaseColumns._ID + "=?", new String[] { captureimageid });
String[] projection = { MediaStore.Images.ImageColumns.SIZE,
MediaStore.Images.ImageColumns.DISPLAY_NAME,
MediaStore.Images.ImageColumns.DATA, BaseColumns._ID, };
AppLog.i("InfoLog", "on activityresult Uri u " + u.toString());
try {
if (u != null) {
c = managedQuery(u, projection, null, null, null);
}
if ((c != null) && (c.moveToLast())) {
ContentResolver cr = getContentResolver();
int i = cr.delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
BaseColumns._ID + "=" + c.getString(3), null);
AppLog.i("TAG", "Number of column deleted : " + i);
}
} finally {
if (c != null) {
c.close();
}
}