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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:59:25+00:00 2026-06-11T14:59:25+00:00

I used this page: http://developer.android.com/guide/topics/media/camera.html To learn how to use the existing camera app

  • 0

I used this page: http://developer.android.com/guide/topics/media/camera.html

To learn how to use the existing camera app to take a photo & return a result for my app.

Sometimes the image saves, sometimes it doesn’t. I’m testing on a Samsung Galaxy Tablet (8.9). If I leave the resolution at the highest setting (2048×1536) & take the photo in portrait, the image never saves. If I take the photo in landscape, the image saves most of the time. If I reduce it to 1024×768, the image saves most of the time (whether portrait or landscape).

Looking for a direction to figure this one out.

private void startCameraForCapture() {

    // create Intent to take a picture and return control to the calling application    
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

    try {

        fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE, getApplicationContext()); // create a file to save the image  
        intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name

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


    } catch (Exception e) {
        // TODO Auto-generated catch block

        _errorMessageTitle = "Error 'StartCamera'";

        _errorMessage = "Error: " + e.toString();

        showDialog(DIALOG_ERROR_GENERAL);

    }

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {    
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) {        

        if (resultCode == RESULT_OK) {            

            showPhoto(2);

        } else if (resultCode == RESULT_CANCELED) {            

            // User cancelled the image capture        

        } else {            

            // Image capture failed, advise user    
            _errorMessageTitle = "Error in 'Take Photo'";

            _errorMessage = "Image Capture Failed";

            showDialog(DIALOG_NOTICE_GENERAL);

        }    

    }    

    if (requestCode == CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE) {        

        if (resultCode == RESULT_OK) {    

            Toast.makeText(getApplicationContext(), "Video not yet supported", Toast.LENGTH_LONG).show(); 

            // Video captured and saved to fileUri specified in the Intent           


        } else if (resultCode == RESULT_CANCELED) {           

            // User cancelled the video capture       

        } else {           

            // Video capture failed, advise user       

        }    

    }

}
  • 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-11T14:59:27+00:00Added an answer on June 11, 2026 at 2:59 pm

    Sorry, should have resolved this a while back. The problem was my being a noob to Android.

    In the OnCreate method I had a function that was deleting files from the Temp folder I used to store the images from the photo (I added in OnCreate for cleanup purposes).

    I found out that OnCreate gets called again when there is an orientation change.

    On some Samsung devices, the camera rotates the screen from portrait (which was the only orientation that I was allowing in my app) to landscape.

    When the photo was taken, depending on if the user rotated their device prior to selecting “Save Image”, the orientation was changing.

    Since the orientation was changing, the function I used to delete the temp files was being called. Felt pretty dumb after I figured it out.

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

Sidebar

Related Questions

I've been following the developer.android.com page http://developer.android.com/guide/publishing/licensing.html#lc-lcc for directions on using the ServerManagedPolicy type
I am mostly following this page: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html I used this command to create the
I've used the exact files from this tutorial: http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/ The ideea is to submit
I used to be able to do this to create an exported HTML page
I used this MSDN example to construct my console host app: http://msdn.microsoft.com/en-us/library/ms731758.aspx It works
check this page out: http://jsbin.com/itufix with IE (page automatically enables IE7 mode). Here you'll
I used this code to print the current page: <form> <input type=button value=Print onClick=window.print();
I have used this code for extracting urls from web page.But in the line
I want the date to be sn at my page, I used this fn
In my web page i used a gridview. In this gridview it shows a

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.