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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:41:42+00:00 2026-05-20T01:41:42+00:00

This sounds like a issue a beginner like me would only have…this is my

  • 0

This sounds like a issue a beginner like me would only have…this is my code…

    private void saveAvatar(Bitmap avatar) {
    String strAvatarFilename =  Id + ".jpg"; 
    try {
        avatar.compress(CompressFormat.JPEG, 100, openFileOutput(strAvatarFilename, MODE_PRIVATE));
    } catch (Exception e) {
        Log.e(DEBUG_TAG, "Avatar compression and save failed.", e);
    }
    Uri imageUriToSaveCameraImageTo = Uri.fromFile(new File(PhotoActivity.this.getFilesDir(), strAvatarFilename));
    Editor editor = Preferences.edit();
    editor.putString(PREFERENCES_AVATAR, imageUriToSaveCameraImageTo.getPath());
    editor.commit();
    ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar);
    String strAvatarUri = Preferences.getString(PREFERENCES_AVATAR, "");
    Uri imageUri = Uri.parse(strAvatarUri);
    avatarButton.setImageURI(null); 
    avatarButton.setImageURI(imageUri);
}

This does save the image but when i go to look at the image on the sd card ti is called imag001 etc not the ID i am labelling it. How do i save the image with a name i want to call it? regards

EDIT

I found out something interesting…I believe on the SD card in the DCIM/100MEDIA the image taken by the application is stored using the name the phone has set as default. However, under data/data/com.andorid.packagename/files/ the image mayalso is being stored with the name i give to it.

  • 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-20T01:41:43+00:00Added an answer on May 20, 2026 at 1:41 am

    Ostensibly, it seems as if you’re setting the filename with the second line of code:

    String strAvatarFilename =  Id + ".jpg";
    

    I don’t know where Id is coming from, you haven’t included enough context for that, but it seems reasonable that it contains ‘imag001’. To name your image something else, you need some other way to set that value. That could look hundreds of different ways.

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

Sidebar

Related Questions

This sounds like a problem many others have posted about, but there's a nuance
I have to play sounds on GUI events, like clicking buttons etc. For this
This sounds like a really simple question, but I am new to PHP. If
I know this sounds like a homework assignment, but it isn't. Lately I've been
I know this sounds like a dumb question but I need to ask this.
I apologise if any of this sounds like a broken record but I've trawled
This probably sounds like a terrible idea at first glance, but here is my
This may sounds like a stupid question but can't find anything on google, probably
I found this answer and it sounds like almost exactly what I'm doing. I
This may sound like a very generic question but here it goes. I have

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.