Alex Rivera | Logout

Phonegap app quits after Camera captures image. [Android]

Asked 2012-02-16T00:15:20.007
16

I'm getting an error with Phonegap 1.4.1.

The phonegap app I create restarts after I am returned to the app after taking a picture.

Here is the code I'm using:

function capturePhoto() {
  // Take picture using device camera and retrieve image as base64-encoded string
  navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.FILE_URI });
}

function onPhotoURISuccess(imageURI) {
  // Uncomment to view the image file URI 
  // console.log(imageURI);

  // Get image handle
  //
  var largeImage = document.getElementById('largeImage');

  // Unhide image elements
  //
  largeImage.style.display = 'block';

  // Show the captured photo
  // The inline CSS rules are used to resize the image
  //
  largeImage.src = imageURI;
}
Edit
Report

1 Answer

1

Lowering to 25 and using <preference name="android-minSdkVersion" value="7" /> helped me out!

answered 2012-04-17T21:44:24.127

Your Answer