Working with images on Android is like getting crazy. For a few hours I try to get all images from phone and show them into list (RecyclerView).
And then when user taps on the image, it should open a new full screen activity to display high resolution image.
I have search for a lot of tutorials on Google, but all of them seems too old and not complete at all.
Can anyone explain me how to solve this? Or link to any newer tutorial on this would be great.
My guess is that I should query MediaStore for Thumbnails and then display images in list.
Something like this:
private void getAllImages(){
String[] projection = {MediaStore.Images.Media._ID};
String orderBy = MediaStore.Images.ImageColumns._ID + " DESC"; // Create the cursor pointing to the SDCard
cursor = managedQuery(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
projection, // Which columns to return
null, // Return all rows
null,
orderBy);
// Get the column index of the Thumbnails Image ID
columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);
}
But how I could get full resolution images, when user taps on the image in the list?
And why a lot of thumbnails has wrong orientation?