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 7694617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:21:36+00:00 2026-05-31T21:21:36+00:00

I use below code to get photo’s path and id: String[] projection = {MediaStore.Images.Media._ID,

  • 0

I use below code to get photo’s path and id:

String[] projection = {MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, MediaStore.Images.ImageColumns.DATA};  
Cursor cursor = managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, MediaStore.Images.Media._ID); 
int count = cursor.getCount();
int image_column_index = cursor.getColumnIndex(MediaStore.Images.Media._ID); 
int image_path_index = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
int i;
for(i = 0; i < count; i++) {
cursor.moveToPosition(i);
long id = cursor.getInt(image_column_index);
String p = cursor.getString(image_path_index);
photo.add(id, p);
}

And use below code to get thumbnail:

bitmap = MediaStore.Images.Thumbnails.getThumbnail(this.getApplicationContext().getContentResolver(), id, MediaStore.Images.Thumbnails.MICRO_KIND, null);

While I delete one photo by its path.
The thumbnail of the delete one’s still exist.
How to delete the thumbnail at the same time?

  • 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-05-31T21:21:38+00:00Added an answer on May 31, 2026 at 9:21 pm

    You should be able to use the id from the query for the images(the MediaStore.Images.Media._ID column) and then query the MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI to delete the thumbnail with the MediaStore.Images.Thumbnails.IMAGE_ID equal to that id(IMAGE_ID is the same id as the id from MediaStore.Images.Media._ID).

    long id = cursor.getInt(image_column_index); // this is the id from MediaStore.Images.Media._ID but also the IMAGE_ID from MediaStore.Images.Thumbnails
    
    // if you delete the photo with this above id and also want to delete the thumbnail:
    ContentResolver cr = getContentResolver(); // in an Activity
    cr.delete(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
                    MediaStore.Images.Thumbnails.IMAGE_ID + " = ?", new String[] {"" + id});
    

    I didn’t play much with the MediaStore so this could be wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use below code to show photo in GridView: String[] projection = {MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA,
I use below code to get image file path and it thumbnail. String[] projection
I use below code to get the bitmap of all sd card photo. String[]
When I try to use the code below I get a duplicate variable error
The code below is what I am trying to use in order to get
In the code below I use mpf_add to add the string representation of two
I wrote the below code to get a string (encrypted) from the user, and
I use below code for getting full file path My problem is using file.value
When I use the below code I get a very poorly formatted output. One
Iam using below code for uploading images on the remote server.When I use below

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.