I am doing this as well.

I still get the out of memory errors.  Here's my setup -

1. I create a "main menu activity" that shows an introductory screen.
There's a big START button on that screen.  When pressed, it opens a
second activity with the camera preview SurfaceView on it.
2. When the second view is opened and closed repeatedly, I get out of
memory errors.

I'm handling this condition gracefully, retrying when it happens,
which at least causes the application to not crash and allows me to
manage application state.  But, it's just a workaround.

Any other thoughts as to why this happens?

Richard Schilling
Root Wireless

On Jul 19, 11:45 pm, elixir <[email protected]> wrote:
> I ran in to this issue too. If you release() yourCameraobject during
> surfaceDestroyed you will not get this exception. Using the
> CameraPreview.java as an example I now have:
> mCamera.stopPreview();
> mCamera.release();
> mCamera = null;
>
> It works great and the app can restart properly.
>
> On Jun 17, 8:23 am, Boshik <[email protected]> wrote:
>
> > Hi,
>
> > After a few weeks on market with my app (Ghosts AR) I found few
> > interesting issues coming from the users who installed the program. On
> > some of the devices my application fails with exception:
>
> > java.lang.RuntimeException:Out of memory
> >         at android.hardware.Camera.native_setup(Native Method)
> >         at android.hardware.Camera.<init>(Camera.java:82)
> >         at android.hardware.Camera.open(Camera.java:64)
>
> > Strange that I'm personally never got it on my G1 (1.5 firmware).
>
> > Any ideas?
>
> > Thanks,
> > Alex
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to