I'm seeing sporadic errors on my app regarding the camera itself. I
tested on nexus one (2.2), mytouch 3g (1.6) without issue, i'm using
the 1.6 API to support older phones so I lose features in the new API,
but I still can't figure out what is causing these crashes. Users
report it force closes when trying to take a picture...I see the
following crash reports:
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.bluephoenixmedia.mywardrobe.PreviewView.setupCamera(PreviewView.java:
162)
at
com.bluephoenixmedia.mywardrobe.PreviewView.surfaceCreated(PreviewView.java:
86)
at android.view.SurfaceView.updateWindow(SurfaceView.java:540)
at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)
at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
at android.view.View.draw(View.java:6742)
at android.widget.FrameLayout.draw(FrameLayout.java:352)
at android.view.ViewGroup.drawChild(ViewGroup.java:1648)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1375)
at android.view.View.draw(View.java:6742)
at android.widget.FrameLayout.draw(FrameLayout.java:352)
at com.android.internal.policy.impl.PhoneWindow
$DecorView.draw(PhoneWindow.java:1872)
at android.view.ViewRoot.draw(ViewRoot.java:1422)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:144)
at android.app.ActivityThread.main(ActivityThread.java:4937)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Anyone have any ideas? I have the correct permissions in the right
spot in manifest and my code for the camera is based off the example
given on the dev site. Specifically it is crashing here :
try {
camera_ = Camera.open();
camera_.setPreviewDisplay(surfacehldr_);
}
could it be that the camera is already open somehow? if so how could I
handle this so it doesn't force close? Thanks!
--
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