I had that already and won't work anyway, here is the code:
ThenNnowMode.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mCamera.stopPreview();
mCamera.release();
Intent TNNIntent = new Intent(v.getContext(),
thenNnowMode.class);
Bundle f = new Bundle();
String activityName = "cameraView";
f.putString("activity", activityName);
f.putParcelable("bitmap", findPicture);
f.putString("id", picId);
f.putString("date", picDate);
f.putString("keywords", picKeywords);
f.putString("comments", picComments);
TNNIntent.putExtras(f);
startActivity(TNNIntent);
finish();
}
});
On Aug 11, 2010, at 5:32 PM, Mark Murphy wrote:
You are getting "Method called after release()" triggered by a call to
stopPreview() from your surfaceDestroyed(). Call stopPreview() before
release()-ing the Camera.
On Wed, Aug 11, 2010 at 12:24 PM, Pedro Teixeira
<pedroteixeir...@gmail.com> wrote:
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
--
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 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
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 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