android > camera - closes app

140 views
Skip to first unread message

cole peterson

unread,
Jan 28, 2012, 6:35:53 PM1/28/12
to phonegap, re...@zaaz.com
Running example code.

// Take picture using device camera and retrieve image as base64-
encoded string
navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
quality : 50

Device camera launches.
I take a picture.
I get prompted to 'save' or 'discard'.

My App then relaunches.

onPhotoDataSuccess or onFail never get called.

thoughts?

thanks
cp

cole peterson

unread,
Jan 28, 2012, 7:04:49 PM1/28/12
to phonegap
The code works if I specify
android:screenOrientation="landscape"
in the AndroidManifest.xml
thoughts?
cp

On Jan 28, 3:35 pm, cole peterson <co...@zaaz.com> wrote:
> Running example code.
>
> // Take picture using devicecameraand retrieve image as base64-
> encoded string
>         navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
>                 quality : 50
>
> Devicecameralaunches.
> I take a picture.
> I get prompted to 'save' or 'discard'.
>
> MyAppthen relaunches.

Simon MacDonald

unread,
Jan 30, 2012, 9:48:23 AM1/30/12
to phon...@googlegroups.com
Make sure your mail activity tag has the following attribute:

    android:configChanges="orientation|keyboardHidden"

If not it will restart on each orientation change.

Simon Mac Donald
http://hi.im/simonmacdonald


--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

Rommel Peixoto

unread,
Feb 10, 2012, 1:58:56 PM2/10/12
to phon...@googlegroups.com
I have this problem...

My App relaunches after getPicture, in my device (Galaxy 5).
Simulator work fine.


Rommel Peixoto
Systems Analyst
Project Leader



2012/1/30 Simon MacDonald <simon.m...@gmail.com>

Rommel Peixoto

unread,
Feb 10, 2012, 2:08:44 PM2/10/12
to phon...@googlegroups.com
My code:

function getPicture() {
    navigator.camera.getPicture(dump_pic, onFail, {
        quality : 30,
        sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
        destinationType: navigator.camera.DestinationType.FILE_URI
    });
}



Rommel Peixoto
Systems Analyst
Project Leader



2012/2/10 Rommel Peixoto <romm...@gmail.com>

Rommel Peixoto

unread,
Feb 12, 2012, 5:34:21 PM2/12/12
to phon...@googlegroups.com
My application still restarts when I call the function getPicture.
Sometimes works, sometimes not...
Any idea?
Reply all
Reply to author
Forward
0 new messages