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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:37:41+00:00 2026-05-28T14:37:41+00:00

In a MonoDroid app, the following code is used to start the native camera

  • 0

In a MonoDroid app, the following code is used to start the native camera application:

    internal void TakePicture(int pictureId)
    {
        var uri = ContentResolver.Insert(MediaStore.Images.Media.ExternalContentUri, new ContentValues());

        var intent = new Intent(MediaStore.ActionImageCapture);
        intent.PutExtra(MediaStore.ExtraOutput, uri);
        StartActivityForResult(intent, ACTIVITY_RESULT_PICTURE_TAKEN);

        pictureId = pictureId;
        pictureUri = uri;
    }

After the picture has been taken, it’s handled here:

    protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
    {
        if (requestCode == ACTIVITY_RESULT_PICTURE_TAKEN)
        {
            if (resultCode == Result.Ok)
            {
                /* The URI is not a valid path, but something internal to Android
                 * See
                 * https://stackoverflow.com/questions/8448796/monodroid-setting-imageview-to-image-stored-on-sdcard
                 * for more information. */

                if (OnPictureTaken != null)
                    OnPictureTaken(this, new PictureTakenEventArgs(pictureId, GetRealPathFromURI(pictureUri)));
            }
        }
    }

The first 2 attempts to take a picture always succeed, but the 3rd time the
Android camera application allows you to take pictures but it doesn’t close and it
doesn’t return the picture to the application anymore…
(The event handler above doesn’t get called either).

We’re testing this on Asus Transformer 101 tablets (multiple firmware versions)

PS: I found this entry, but I think it’s a different problem.

error after taking several pictures using the android camera

Any suggestions?

Update:
When taking low resolution pictures, the problem does not occur

  • 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-28T14:37:41+00:00Added an answer on May 28, 2026 at 2:37 pm

    I had a similar problem on my Transformer as well, but my problem was that it never worked. I don’t think I ever tried requesting a different image size though. This post helped me, it was Donn Felker’s answer that did the trick for me. I had to ensure an empty file was created before starting the camera intent in order for the camera application to allow the OK button to finish the intent.

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

Sidebar

Related Questions

I have the following test code (based on standard monodroid HelloWorld) namespace TestGREF {
I am about to start building an app that will be used across all
I am converting some java code C# for use in my MonoDroid application. I
My monodroid application builds and runs fine, but breakpoints are not being hit. This
I'm guessing MonoDroid compiles directly into ARM code. And the NDK, too.
I am attempting to get a Native C/C++ library working with Monodroid in the
How do you do the following i MonoDroid? public class ItemListAdapter : BaseAdapter {
Here's the code I'm running: var wc = new WebClient (); var test1 =
I want to use monodroid to develop an android application which runs as a
I'm working on a MonoDroid app, and there really isn't a good DI solution

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.