So, I made sure I'm calling stopPreview followed by release(). And, that's working fine.
But, I also wanted to share with people what other things I had to do in order to integrate the camera surface view into my application. I create an activity that serves as the application's main screen. It allows the user to set some basic parameters/settings. Then the user does something to enable the camera view (e.g. click a button or taps the screen - some event). A new activity with the surfaceview that shows the camera preview starts. It then stops normally. This second activity's sole purpose is to display and hide the camera. I use this second activity as opposed to trying to get the main activity to turn off and on the camera preview on its own surface view. Seems to work much better this way.. Cheers, Richard Schilling 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 -~----------~----~----~----~------~----~------~--~---

