Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:04:48+00:00 2026-06-04T20:04:48+00:00

I have this code (found on this site, somewhere): public static List<MyImages> getImages(Activity context)

  • 0

I have this code (found on this site, somewhere):

    public static List<MyImages> getImages(Activity context) {
    List<MyImages> lst = new ArrayList<MyImages>();
    Cursor cursor = getCameraThumbImages(context);
    if (cursor != null) {
        int columnIndex = cursor
                .getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);
        int columnIndexPath = cursor
                .getColumnIndexOrThrow(MediaStore.Images.Thumbnails.DATA);
        int columnIndexImagePath = cursor
                .getColumnIndexOrThrow(MediaStore.Images.Thumbnails.IMAGE_ID);
        int count = cursor.getCount();
        for (int i = 0; i < count; i++) {
            cursor.moveToPosition(i);

            int imageID = cursor.getInt(columnIndex);
            String path = cursor.getString(columnIndexPath);
            Uri imgThmbPath = Uri.withAppendedPath(
                    MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, ""
                            + imageID);
            String hope = cursor.getString(columnIndexImagePath);
            MyImages p2p = new MyImages(path, "" + imageID);
            lst.add(p2p);
        }
    }

    return lst;
}

This code allow me to access the thumbnails of the images on my phone. The issue is that I don’t see how to get the original image path from this.

The question is: given the thumbnail (or the cursor), how do i get the original image path?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:04:49+00:00Added an answer on June 4, 2026 at 8:04 pm

    In thumbnail you have MediaStore.Images.Thumbnails.IMAGE_ID field, you can obtain related image id from it. Than make a query to MediaStore.Images.Media and get path to your photo from MediaStore.Images.Media.DATA field.

    EDIT

    // First request thumbnails what you want
    String[] projection = new String[] {MediaStore.Images.Thumbnails._ID, MediaStore.Images.Thumbnails.IMAGE_ID};
    Cursor thumbnails = contentResolver.query(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, projection, null, null, null);
    
    // Then walk thru result and obtain imageId from records
    for (thumbnails.moveToFirst(); !thumbnails.isAfterLast(); thumbnails.moveToNext()) {
        String imageId = thumbnails.getString(thumbnails.getColumnIndex(Thumbnails.IMAGE_ID));
    
        // Request image related to this thumbnail 
        String[] filePathColumn = { MediaStore.Images.Media.DATA };
    
        Cursor images = contentResolver.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, filePathColumn, MediaStore.Images.Media._ID + "=?", new String[] {imageId}, null);
    
        if (cursor != null && cursor.moveToFirst()) {
            // Your file-path will be here
            String filePath = cursor.getString(cursor.getColumnIndex(filePathColumn[0]));
        }
    
    }
    
    //Of course you need to restrict queries using selection and selection args params and get only rows that you really need
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this code for reverse geocoding: var point = new GLatLng (lat[1],long[1]);
I currently have this useful code that I found elsewhere on StackOverflow: form.DrawToBitmap(bmp, new
I have this Objective-C code that I found somewhere. Honestly, I don't understand a
VS 2008 I have this code snippet I found on a VB website. But
I have this code which I have found from google. It's a adapter for
I want to force the download of an image. I have found this code:
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code
Hi i have problem with this code, i found it on the internet and
I have found this line of code in a game that I study int
I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.