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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:48:01+00:00 2026-06-03T11:48:01+00:00

I’m having an issue where I’m using the camera app to take a photo

  • 0

I’m having an issue where I’m using the camera app to take a photo & the photo is being deleted before I get a chance to use it in my app. Seems to only happen on certain devices (Samsung Galaxy S2, Samsung Galaxy Tab 10.1, and an LG., don’t remember the model). Each activity in my app sets the screen orientation to portrait (manifest: android:screenOrientation=”portrait”). How I can reproduce problem:
1. Hit “take photo” button from my app, this loads the camera app.
2. Take photo in portrait, which creates the file in the proper location (based on the URI I provided) & displays a preview, in the camera app.
3. Keep device in portrait & hit “Save Image” (which brings you back to my app).
4. When I return to my app, I check if the file exists, and it doesn’t.

If you snap the photo in portrait, then rotate the device to landscape (when the preview is displayed), then hit “Save Image” (while in landscape), the photo is not deleted.

If you snap the photo in landscape (and leave the device in landscape when you hit save), the photo is not deleted.

If you snap the photo in landscape, then rotate the preview to portrait, the photo is not deleted.

I’ve read & googled & have pulled my hair out trying to figure this one out.

When the photo is taken & saved in portrait, when returned back to my app, my app is in landscape, then rotates to portrait.

Any help at all (even if it’s a link to another post that has the answer) is appreciated!

Thank you 🙂

Here is some of my code (when the problem occurs, _cameraFileUri is null):

      Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

        _cameraFileUri = Uri.fromFile(new File(_tempFolder, "tempFromCamera.jpg"));

        intent.putExtra(MediaStore.EXTRA_OUTPUT, _cameraFileUri); // set the image file name

        // start the image capture Intent
        startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);


                    if (_cameraFileUri != null) {

                    File origFile = new File(_cameraFileUri.getPath());

                    resizePhoto(origFile);

                    showPhoto();

                } else {
                    Toast.makeText(getApplicationContext(), "Error: Capture Photo Failed.", Toast.LENGTH_LONG).show(); 

                }
  • 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-03T11:48:04+00:00Added an answer on June 3, 2026 at 11:48 am

    Sorry, this one is resolved. I honestly waited for a week before posting in this forum. I knew that as soon as I posted it, I’d figure out the answer.

    The app rotating was the giveaway. It’s recreating the activity, so it was rerunning the onCreate method. For “house keeping” I delete the files in my temp folder. I do this in “onCreate”. So when onCreate was rerunning, it would delete the photo the camera put in the Temp folder.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.