I have a phonegap application (cordova) working with corridor 3.1.0, and when I call
navigator.camera.getPicture(success,fail,options)
with parameters
var options={ destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.SAVEDPHOTOALBUM, encodingType: navigator.camera.EncodingType.JPEG, mediaType: navigator.camera.MediaType.Picture }
the success callback is not called after the user has selected the photo.
If I call then
navigator.camera.getPicture(success,fail,options)
again, the success callback from the first getPicture is called with the photo selected in the first step.
I poked in CameraLauncher.java (around line 395 onwards) and it seems like it is calling
this.callbackContext.success(uri.toString());
in
onActivtyResult, but this does not seem to be passed back until the next call to getPicture ().
Anyone else come across this?
Further digging shows the same thing that happens when calling getPicture from the camera.
I’m interested, because when the camera’s activity ends, web browsing has not resumed, so there’s nowhere to go for a callback - but at best it’s a wild assumption.
After 24 hours, it seems that upgrading to Cordova 3.1.0.jar and dumping 3.1 bytes directly into an existing 3.0 project resolved this problem.