title: "Camera cancelled" error in phonegap android
body: <p>Iam trying take a picture using camera and store the path of the image in database. I have written the code for taking picture using camera.The camera opens and then shows an error message as camera cancelled .
  This is my js code  :</p>
  
  <pre><code>.controller('cameractrl', function($scope, Myfactory,$window,$cordovaSQLite) 
           {
     alert("cameractrl");
     $scope.capturePhoto=function() 
     {                                                          
          navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
          sourceType :Camera.PictureSourceType.CAMERA,
          destinationType: Camera.DestinationType.FILE_URI, });
    }
  
       function onPhotoDataSuccess(imageURI) {
          alert("got image file entry: " + fileEntry.fullPath);
  
    }
  </code></pre>
  
  <p>And i have added the following permission in AndroidManifest:</p>
  
  <pre><code> &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-feature android:name="android.hardware.camera" /&gt;
  &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;
  </code></pre>
  
  <p>and in config.xml i have added this:</p>
  
  <pre><code>  &lt;plugin name="Camera" value="org.apache.cordova.CameraLauncher" /&gt;
  </code></pre>
  
  <p>But still the camera is opening? and then it closes with the alert Camera Cancelled.
  any solutions???</p>
  
  <p>Here is my config.xml</p>
  
  <pre><code>  &lt;?xml version='1.0' encoding='utf-8'?&gt;
    &lt;widget id="com.ionicframework.starter" version="0.0.1"       xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"&gt;
  &lt;preference name="loglevel" value="DEBUG" /&gt;
  &lt;feature name="Keyboard"&gt;
      &lt;param name="android-package" value="com.ionic.keyboard.IonicKeyboard" /&gt;
      &lt;param name="onload" value="true" /&gt;
  &lt;/feature&gt;
  &lt;feature name="AdMob"&gt;
      &lt;param name="android-package" value="com.rjfun.cordova.plugin.AdMob" /&gt;
  &lt;/feature&gt;
  &lt;feature name="Device"&gt;
      &lt;param name="android-package" value="org.apache.cordova.device.Device" /&gt;
  &lt;/feature&gt;
  &lt;feature name="Camera"&gt;
      &lt;param name="android-package" value="org.apache.cordova.camera.CameraLauncher" /&gt;
  &lt;/feature&gt;
  &lt;feature name="SQLitePlugin"&gt;
      &lt;param name="android-package" value="org.pgsqlite.SQLitePlugin" /&gt;
  &lt;/feature&gt;
  &lt;feature name="File"&gt;
      &lt;param name="android-package" value="org.apache.cordova.file.FileUtils" /&gt;
      &lt;param name="onload" value="true" /&gt;
  &lt;/feature&gt;
  &lt;feature name="FileTransfer"&gt;
      &lt;param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer" /&gt;
  &lt;/feature&gt;
  &lt;feature name="Media"&gt;
      &lt;param name="android-package" value="org.apache.cordova.media.AudioHandler" /&gt;
  &lt;/feature&gt;
  &lt;name&gt;HelloCordova&lt;/name&gt;
  &lt;description&gt;
      An Ionic Framework and Cordova project.
  &lt;/description&gt;
  &lt;author email="hi@ionicframework" href="http://ionicframework.com/"&gt;
    Ionic Framework Team
  &lt;/author&gt;
  &lt;content src="index.html" /&gt;
  &lt;access origin="*" /&gt;
  &lt;preference name="webviewbounce" value="false" /&gt;
  &lt;preference name="UIWebViewBounce" value="false" /&gt;
  &lt;preference name="DisallowOverscroll" value="true" /&gt;
  &lt;preference name="BackupWebStorage" value="none" /&gt;
  &lt;preference name="AndroidPersistentFileLocation" value="Compatibility" /&gt;
  &lt;preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external" /&gt;
  &lt;plugin name="Camera" value="org.apache.cordova.CameraLauncher" /&gt;
  </code></pre>
  
  <p></p>