title: Cordova, navigator.camera.getPicture
body: <p>I'm following the full example present on this location <a href="https://github.com/apache/cordova-docs/blob/master/docs/en/edge/cordova/camera/camera.getPicture.md" rel="nofollow">Full example</a>, the quick example too... But the problem is that I can take the picture, although when I click on button to confirm my picture nothing happens. </p>
  
  <p>Can someone help me?
  Thanks</p>
  
  <p>First, thanks Andrew!</p>
  
  <p>this is my index.html</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="cordova.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
  
      // Wait for device API libraries to load
      //
         document.addEventListener("deviceready",onDeviceReady,false);
  
     // device APIs are available
     //
        function onDeviceReady() {
                pictureSource=navigator.camera.PictureSourceType;
                destinationType=navigator.camera.DestinationType;
        }
  
     // Called when a photo is successfully retrieved
     //
         function onPhotoDataSuccess(imageData) {
               // Uncomment to view the base64-encoded image data
                 //console.log(imageData);
  
              // Get image handle
              //
              var smallImage = document.getElementById('smallImage');
  
              // Unhide image elements
              //
               smallImage.style.display = 'block';
  
              // Show the captured photo
              // The in-line CSS rules are used to resize the image
              //
                smallImage.src = "data:image/jpeg;base64," + imageData;
         }
  
       // Called when a photo is successfully retrieved
       //
        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 in-line CSS rules are used to resize the image
           //
            largeImage.src = imageURI;
        }
  
  // A button will call this function
  //
      function capturePhoto() {
      // Take picture using device camera and retrieve image as base64-encoded string
            navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
                destinationType: destinationType.DATA_URL });
      }
  
  // A button will call this function
  //
      function capturePhotoEdit() {
      // Take picture using device camera, allow edit, and retrieve image as base64-         encoded string
    navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit:     true,
      destinationType: destinationType.DATA_URL });
  }
  
  // A button will call this function
  //
  function getPhoto(source) {
    // Retrieve image file location from specified source
    navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
      destinationType: destinationType.FILE_URI,
      sourceType: source });
  }
  
  // Called if something bad happens.
  //
  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="capturePhotoEdit();"&gt;Capture Editable Photo&lt;/button&gt; &lt;br&gt;
      &lt;button onclick="getPhoto(pictureSource.PHOTOLIBRARY);"&gt;From Photo Library&lt;/button&gt;     
      &lt;button onclick="getPhoto(pictureSource.SAVEDPHOTOALBUM);"&gt;From Photo Album&lt;/button&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>This is config.xml</p>
  
  <pre><code> &lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;widget id="br.teste.emp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets"  xmlns:cdv="http://cordova.apache.org/ns/1.0"&gt;
  &lt;name&gt;Hello Cordova&lt;/name&gt;
  &lt;preference name="loglevel" value="DEBUG" /&gt;
  &lt;feature name="App"&gt;
      &lt;param name="android-package" value="org.apache.cordova.App" /&gt;
  &lt;/feature&gt;
  &lt;name&gt;HelloWorld&lt;/name&gt;
  &lt;description&gt;
      A sample Apache Cordova application that responds to the deviceready event.
  &lt;/description&gt;
  &lt;author email="dev@cordova.apache.org" href="http://cordova.io"&gt;
      Apache Cordova Team
  &lt;/author&gt;
  &lt;content src="index.html" /&gt;
  &lt;access origin="*" /&gt;
  &lt;feature name="Camera"&gt;
      &lt;param name="android-package" value="org.apache.cordova.camera.CameraLauncher" /&gt;
  &lt;/feature&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>And this is my class</p>
  
  <pre><code>package br.teste.emp;
  import android.os.Bundle;
  import org.apache.cordova.*;
  
  public class HelloWorld extends CordovaActivity {
     @Override
     public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.init();
        // Set by &lt;content src="index.html" /&gt; in config.xml
        super.loadUrl(Config.getStartUrl());
        // super.loadUrl("file:///android_asset/www/index.html")
     }
  }
  </code></pre>