I want to show to the user his latest photos or screenshot made by him in my app.
String[] projection = new String[]{
MediaStore.Images.ImageColumns._ID,
MediaStore.Images.ImageColumns.DATA,
MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
MediaStore.Images.ImageColumns.DATE_TAKEN,
MediaStore.Images.ImageColumns.MIME_TYPE
};
final Cursor cursor = getActivity().getContentResolver()
.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null,
null, MediaStore.Images.ImageColumns.DATE_TAKEN + " DESC");
In order to get the latest photos on the phone i use Cursor
.
How can i check if the picture/screenshot was taken on this phone?
I don't want unrelated WhatsApp photos (or other apps) to be shown, only photos from camera roll and screenshots.