title: App closing after choosing image or taking picture
body: <p>I am using the most recent version of the phonegap software inside Dreameweaver CS6. I took the starting example HTML file from the github website and imported it into DW. I then testing that app out and all worked with my location, map, etc.</p>
  
  <p>However, i changed the code now to be able to either take a picture or choose a picture on my android phone and every time i do either/or it closes the app.</p>
  
  <p>The HTML code is:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Capture Photo&lt;/title&gt;
      &lt;script type="text/javascript" charset="utf-8" src="phonegap.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" charset="utf-8"&gt;
      var pictureSource;   // picture source
      var destinationType; // sets the format of returned value 
  
      document.addEventListener("deviceready",onDeviceReady,false);
  
      function onDeviceReady() {
          pictureSource=navigator.camera.PictureSourceType;
          destinationType=navigator.camera.DestinationType;
      }
  
      function onPhotoDataSuccess(imageData) {
        var smallImage = document.getElementById('smallImage');
        smallImage.style.display = 'block';
        smallImage.src = imageData;
      }
  
      function onPhotoURISuccess(imageURI) {
        var largeImage = document.getElementById('largeImage');
  
        largeImage.style.display = 'block';
        largeImage.src = imageURI;
      }
  
      function capturePhoto() {
        navigator.camera.getPicture(getPhoto, onFail, { quality: 50, destinationType: destinationType.FILE_URI });
      }
  
      function capturePhotoEdit() {
        // Take picture using device camera, allow edit, and retrieve image as base64-encoded string  
        navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 100, allowEdit: false }); 
      }
  
      function getPhoto(source) {
        // Retrieve image file location from specified source
        navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 100, 
          destinationType: destinationType.FILE_URI,
          sourceType: source });
      }
  
      function onFail(message) {
        alert('Failed because: ' + message);
      }
  
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;button onclick="capturePhoto();"&gt;Capture Photo&lt;/button&gt; &lt;br&gt;
      &lt;button onclick="getPhoto(pictureSource.PHOTOLIBRARY);"&gt;From Photo Library&lt;/button&gt;&lt;br&gt;
      &lt;img style="display:none;width:60px;height:60px;" id="smallImage" src="" /&gt;
      &lt;img style="display:none;" id="largeImage" src="" /&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And the config.xml is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;widget xmlns       = "http://www.w3.org/ns/widgets"
      xmlns:gap       = "http://phonegap.com/ns/1.0"
      id              = "com.xxxxxxxx.DKGApp"
      version         = "1.0.0"&gt;
  
      &lt;name&gt;DKG App&lt;/name&gt;
  
      &lt;description&gt;
          An app that allows uploading their random images they take to our facebook website!
      &lt;/description&gt;
  
      &lt;author href    ="http://www.xxxxxxxx.com"  email       ="mail@xxxxxxxx.com"&gt;
          David
      &lt;/author&gt;
  
      &lt;gap:splash src="splash.png" /&gt;
  
      &lt;icon src="icon.png" gap:role="default" /&gt;
  
      &lt;feature name="http://api.phonegap.com/1.0/network" /&gt;
      &lt;feature name="http://api.phonegap.com/1.0/camera"/&gt;
      &lt;feature name="http://api.phonegap.com/1.0/file"/&gt;
      &lt;feature name="http://api.phonegap.com/1.0/media"/&gt;
  
      &lt;preference name="android-minSdkVersion" value="7" /&gt;
      &lt;preference name="orientation" value="portrait" /&gt;
      &lt;preference name="target-device" value="universal" /&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>Am i missing something that is needed in order for this to work and not crash everytime?</p>
  
  <p>Thanks!</p>