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

The Archive Base Latest Questions

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

I use the line below to get thumbnail: bitmap = MediaStore.Images.Thumbnails.getThumbnail(act.getApplicationContext().getContentResolver(), fid, MediaStore.Images.Thumbnails.MICRO_KIND, null);

  • 0

I use the line below to get thumbnail:

bitmap = MediaStore.Images.Thumbnails.getThumbnail(act.getApplicationContext().getContentResolver(), fid, MediaStore.Images.Thumbnails.MICRO_KIND, null);

And I try to rename file name with below code:

File rename = new File(oldname);
String newpath = newname;
rename.renameTo(new File(newname));

And use below code to update database:

IntentFilter intentfilter = new IntentFilter(Intent.ACTION_MEDIA_SCANNER_STARTED);
intentfilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
intentfilter.addDataScheme("file");
MediaScannerReceiver scanSdReceiver = new MediaScannerReceiver();
registerReceiver(scanSdReceiver, intentfilter);
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory().getAbsolutePath()))); 

public class MediaScannerReceiver extends BroadcastReceiver {  
@Override  
public void onReceive(Context context, Intent intent) {  
String action = intent.getAction();
if(action.equals("android.intent.action.MEDIA_SCANNER_FINISHED")) { 
bitmap = MediaStore.Images.Thumbnails.getThumbnail(act.getApplicationContext().getContentResolver(), fid, MediaStore.Images.Thumbnails.MICRO_KIND, null);
}
} 
}  

The file name change success, the file id also get the new one.
But the thumbnail showed was wrong one.
How to get the right one thumbnail?

  • 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:28:36+00:00Added an answer on May 31, 2026 at 9:28 pm

    It may cause by thumbnail does not be delete.
    And the file which after rename one has the same id.
    So show the old one’s thumbnail.
    You may try to clean /sdcard/DCIM/.thumbnails folder, and create new one.

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

Sidebar

Related Questions

The error I get says that the fill_n line below is trying to use
I use this line below for create my Bitmap: Bitmap b = new Bitmap(@C:\<file
I use the line below in my C# winform app, this works great but
i use this line of code : [self parseXMLFileAtURL:url]; And i get this error
Why cant I use photo__slug=photo_slug in the line of code below: photo = get_object_or_404(Photo,
I get an error, a red line below the variable intAge in the if-statement
I usually use this line to import file from out of the current folder
I want to use this line of code: using (ADataContext _dc = new ADataContext(ConnectionString),
I'm trying to use this line to detect browser type: IE or Firefox. alert(isBrowser(Microsoft));
I'm trying to use this line of code to accept URL variables with spaces

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.