title: Phonegap camera and capture restart app
body: <p>I am implementing a photo upload feature in my application,
  user can upload a photo in two different ways, using the camera or photo album.</p>
  
  <p>Main problem is when I open the camera or photo album the app is restarted.
  I used different foreground camera plugins but problem is not solved.</p>
  
  <p>When the camera or album opens, the app automatically pause and resume,
  I'm already using resume event in my app, when app resumes opens the home page.</p>
  
  <p>I need, after finishing image upload, to go to the previous page and not open the home page.
  I'm using cordova 3.6.4 version.</p>
  
  <pre><code>function captureImage() {
          navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 1                    
  });
      //window.history.back();
  }
  function captureSuccess(mediaFiles) {
          //alert("###1");
          var i, len;
          for (i = 0, len = mediaFiles.length; i &lt; len; i += 1) {
              uploadFile(mediaFiles[i]);
          }
  }
  function uploadFile(mediaFile) {
          //alert("###2");
          var ft = new FileTransfer(),
              path = mediaFile.fullPath,
              name = mediaFile.name;
                  //alert("image path "+path);
  
  
         ft.upload(path,
              "http://my.domain.com/upload.php",
              function(result) {
                  console.log('Upload success: ' + result.responseCode);
                  console.log(result.bytesSent + ' bytes sent');
              },
              function(error) {
                  alert("image upload failed");
                  console.log('Error uploading file ' + path + ': ' + error.code);
              },
              { fileName: name });
  }
  </code></pre>