Android - Get latest photos taken -


i want show user latest photos or screenshot made him in 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 latest photos on phone use cursor.

how can check if picture/screenshot taken on phone?

i don't want unrelated whatsapp photos (or other apps) shown, photos camera roll , screenshots.

i think post https://stackoverflow.com/a/4495753/2014374 should finding answer.

it used content resolver on images.media.external_content_uri , filters results getting media.bucket_id media bucket name "/dcim/camera"; hope helps.


Comments