Cursor cursor = getContentResolver().query(
MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
projection,
MediaStore.MediaColumns.DATE_ADDED + ">=? and "+MediaStore.MediaColumns.DATE_ADDED +"<=?",
new String[]{"" + date1,""+date2},
MediaStore.Images.ImageColumns.DATE_TAKEN + " DESC");