I've tried stop the cam preview and release it before calling the intent.. it actually goes to the other activity now. but gives an error 1 second after.... This is the errors on the logcat:

08-11 17:22:06.943: ERROR/MediaPlayer(542): Unable to to create media player 08-11 17:22:06.953: ERROR/CameraService(542): Failed to load CameraService sounds. 08-11 17:22:06.953: ERROR/MediaPlayer(542): Unable to to create media player 08-11 17:22:06.953: ERROR/CameraService(542): Failed to load CameraService sounds. 08-11 17:22:09.593: ERROR/MediaPlayer(542): Unable to to create media player 08-11 17:22:09.593: ERROR/CameraService(542): Failed to load CameraService sounds. 08-11 17:22:09.603: ERROR/MediaPlayer(542): Unable to to create media player 08-11 17:22:09.603: ERROR/CameraService(542): Failed to load CameraService sounds. 08-11 17:23:08.543: ERROR/AndroidRuntime(720): Uncaught handler: thread main exiting due to uncaught exception 08-11 17:23:08.733: ERROR/AndroidRuntime(720): java.lang.RuntimeException: Method called after release() 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.hardware.Camera.stopPreview(Native Method) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at com.pedroteixeira.thennnow.cameraView.surfaceDestroyed(cameraView.java: 130) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.SurfaceView.reportSurfaceDestroyed(SurfaceView.java:426) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.SurfaceView.updateWindow(SurfaceView.java:351) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:182) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.View.dispatchDetachedFromWindow(View.java:5580) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1072) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1072) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1072) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1072) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1553) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.ViewRoot.die(ViewRoot.java:2510) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:218) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java: 421) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java: 3393) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.app.ActivityThread.access$2700(ActivityThread.java:116) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1826) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.os.Handler.dispatchMessage(Handler.java:99) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.os.Looper.loop(Looper.java:123) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at android.app.ActivityThread.main(ActivityThread.java:4203) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at java.lang.reflect.Method.invokeNative(Native Method) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at java.lang.reflect.Method.invoke(Method.java:521) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:791) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 08-11 17:23:08.733: ERROR/AndroidRuntime(720): at dalvik.system.NativeStart.main(Native Method)

:S

        
On Aug 11, 2010, at 3:32 PM, Mark Murphy wrote:

On Wed, Aug 11, 2010 at 10:25 AM, Pedro Teixeira
<[email protected]> wrote:
Hi there,

I have a cameraView class which shows me the Cam View with a button
placed on the corner.
Once I click that button I'd like to go to another activity which also
contains the camera view but some other properties. My code is giving
me an undetectable error. I'm not sure what to do. Here is the
cameraView class and the thenNnowMode.class which my intent is calling is exactly the same ... but will load a picture in front of the camera
view instead of having a button. Anyway, is there something I should
do with the cam before moving to another activity that uses cam?

You should really reconsider whether you should be moving to another
activity, rather than implementing all camera-related features in the
one activity. Normally, I am a fan of lots of small activities, but
the Camera does not appear to work well in that pattern, based on
other questions posted to this list and elsewhere.

If you stick with your current plan, you will need to release the
Camera object in the first activity and open it again in the second
activity.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 2.2 Programming Books: http://commonsware.com/books

--
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

Reply via email to