iPad error when cancelling select photo

20 views
Skip to first unread message

Tony Howard

unread,
May 18, 2012, 7:19:44 AM5/18/12
to phon...@googlegroups.com
I need to know if this is a known bug, or a silly code error; can anyone please help?

I have a beta app that works on both iPhone and iPad. The app uses Phonegap 1.6. It uses a very basic code to open the camera roll and select an image:

function selectLibraryPhoto() {

    navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50

                                destinationType: destinationType.FILE_URI,

                                sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM                                });

}



All works well except when the user backs out of adding an image. When this event fires, the library images opens but when the user decides not to select an image, on the iPad an error occurs. On the iPhone you must select a cancel button to close the library window, on the iPad there is no button. You have to select the screen to close the library window.

In both cases the onFail event fires, and gives a simple alert "No image was select", but on the iPad this locks the application, the alert message button cannot be pushed, and the whole screen appears to greyed (behind modal). 

This can't be right? What have I forgotten? Any help gratefully received.

Becka11y

unread,
May 21, 2012, 3:53:03 PM5/21/12
to phon...@googlegroups.com
I don't see this problem with the lastest code.  However, in the latest code, when I dismiss the popover w/o selecting an image the onFail does not fire.   I've submitted https://issues.apache.org/jira/browse/CB-819 and am working on fixing it.

-becky   

Becka11y

unread,
May 21, 2012, 4:40:44 PM5/21/12
to phon...@googlegroups.com
You can probably work around this problem by not using an alert in your onFail callback or use a setTimeout to delay the display of the alert.  I haven't figured out the exact reason, but the problem seems to be trying to display the alert before the popover has been completely removed.    
-becky

Tony Howard

unread,
May 29, 2012, 5:04:03 AM5/29/12
to phon...@googlegroups.com
Becka11y,

Sorry for the delay, thanks for the reply. I tried removing the alert but the error still occurs, will try your other suggestions. Agree that it appears to be a timing issues as the alert appears to be behind a modal view. I think a little experimentation is in order. If I find a way around it I will post.

Thanks again. Tony
Reply all
Reply to author
Forward
0 new messages