Wednesday, September 22, 2010

[android-developers] Method called after release()

Hi, I'm getting this error ( in the end of this post)... which I guess
I understand it's because I'm calling something after releasing it..
but I can't find a wy to work it around... Here is the method:

public void surfaceDestroyed(SurfaceHolder holder) {
mPreviewRunning = false;
mCamera.stopPreview();
mCamera.release();
}

I've tried all combinations.. I've tried:
mCamera.setPreviewCallback(null);
This class, where the surfaceview is implemented can be accessed by 2
different classes.. one that doesnt implement surfaceview and other
that does.. the error just shows me when I go from the activity that
uses the camera to the activity that also uses camera.. I don't know
what else to do.. I've google it and can't find any answer. any
suggestion?


09-22 19:55:57.475: ERROR/AndroidRuntime(900): Uncaught handler:
thread main exiting due to uncaught exception
09-22 19:55:57.605: ERROR/AndroidRuntime(900):
java.lang.RuntimeException: Method called after release()
09-22 19:55:57.605: ERROR/AndroidRuntime(900): at
android.hardware.Camera.stopPreview(Native Method)
09-22 19:55:57.605: ERROR/AndroidRuntime(900): at
com.pedroteixeira.thennnow.cameraView.surfaceDestroyed(cameraView.java:
184)
09-22 19:55:57.605: ERROR/AndroidRuntime(900): at
android.view.SurfaceView.reportSurfaceDestroyed(SurfaceView.java:426)
09-22 19:55:57.605: ERROR/AndroidRuntime(900): at
android.view.SurfaceView.updateWindow(SurfaceView.java:351)
09-22 19:55:57.605: ERROR/AndroidRuntime(900): at
android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:
182)

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate