Thank you Mark! If it is a time-gap, i'd wonder how would one go about fixing this issue? How long does one needs to wait to call Camera.open after it's released?
On Sep 28, 9:45 am, Mark Murphy <mmur...@commonsware.com> wrote: > On Tue, Sep 28, 2010 at 9:41 AM, Streets Of Boston > > > > > > <flyingdutc...@gmail.com> wrote: > > I get this stack-trace in my e-mail at times from my application: > > > java.lang.RuntimeException: Fail to connect to camera service > > at android.hardware.Camera.native_setup(Native Method) > > at android.hardware.Camera.<init>(Camera.java:118) > > at android.hardware.Camera.open(Camera.java:91) > > at com.streetsofboston.smugdroid.snapfx.camera.SmugCamera > > $Preview.surfaceCreated(SmugCamera.java:1541) > > at android.view.SurfaceView.updateWindow(SurfaceView.java:540) > > ... > > ... > > > I have no idea why a Camera.open call in a surfaceCreated would fail. > > I check if the camera already has opened. If so, i close it first, > > then (re)open it. However, it is always closed (at least when i debug > > is) (surfaceDestroyed implementationo closes and releases the camera). > > > What would be causing this stack-trace? > > I think you get that if the Camera is already open. That could mean: > > -- something else has the camera > -- your camera wasn't fully released yet > > There have been enough complaints about the latter that I suspect > there is a time gap between release() and when the camera is truly > released and available to open() again. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training in Atlanta:http://bignerdranch.com/classes/android- Hide > quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en