Thank you!!!!
It finally worked! I had to do it like you said exactlly.. in my case:
if(mCamera!=null){
mPreviewRunning = false;
mCamera.stopPreview();
mCamera.setPreviewCallback(null);
mCamera.release();
mCamera=null;
}
works fine now.. I'm in the other activity with no crashes ;)
Thanks
On Sep 23, 2010, at 10:26 AM, blindfold wrote:
I also find the "Method called after release()" occasionally in my
camera app's crash logs with end users, and have thus far not been
able to track it down because I did not encounter it on my own phones
(ADP1 with Android 1.6 and HTC Desire with Android 2.2). Apparently
something camera related in android.hardware.Camera sometimes lives on
even after releasing the camera, or I overlooked something in doing a
"join" when cleaning up. Difficult to debug. You can try inserting
mCamera.setPreviewCallback(null) in between mCamera.stopPreview() and
mCamera.release(), ending it all with setting mCamera=null and
wrapping everything in a mCamera!=null check and see if that works for
you.
Regards
On Sep 23, 10:35 am, Pedro Teixeira <[email protected]> wrote:
No ideias for this?
I just keep reading on google to release the camera.. and I've just
done that but I get the error anyway..
On Sep 22, 2010, at 11:43 PM, Pedro Teixeira wrote:
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 [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
Pedro Teixeira
www.pedroteixeira.org
--
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
Pedro Teixeira
www.pedroteixeira.org
--
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