All,
I am using the CWAC-Camera-v9 library in my application.
I am seeing a blank screen while the camera launched and the application crashes while taking picture with below error message.
09-24 18:40:08.915: D/PortraitCameraActivity(24228): [DEBUG] Camera takePicture
09-24 18:40:08.920: D/AndroidRuntime(24228): Shutting down VM
09-24 18:40:08.920: W/dalvikvm(24228): threadid=1: thread exiting with uncaught exception (group=0x410f92a0)
09-24 18:40:08.925: D/VM Util(24228): Preview mode must have started before you can take a picture
09-24 18:40:08.925: D/VM Util(24228): java.lang.IllegalStateException: Preview mode must have started before you can take a picture
09-24 18:40:08.925: D/VM Util(24228): at com.commonsware.cwac.camera.CameraView.takePicture(CameraView.java:330)
09-24 18:40:08.925: D/VM Util(24228): at com.commonsware.cwac.camera.CameraFragment.takePicture(CameraFragment.java:162)
09-24 18:40:08.925: D/VM Util(24228): at android.view.View.performClick(View.java:4211)
09-24 18:40:08.925: D/VM Util(24228): at android.view.View$PerformClick.run(View.java:17267)
09-24 18:40:08.925: D/VM Util(24228): at android.os.Handler.handleCallback(Handler.java:615)
09-24 18:40:08.925: D/VM Util(24228): at android.os.Handler.dispatchMessage(Handler.java:92)
09-24 18:40:08.925: D/VM Util(24228): at android.os.Looper.loop(Looper.java:137)
09-24 18:40:08.925: D/VM Util(24228): at android.app.ActivityThread.main(ActivityThread.java:4898)
09-24 18:40:08.925: D/VM Util(24228): at java.lang.reflect.Method.invokeNative(Native Method)
09-24 18:40:08.925: D/VM Util(24228): at java.lang.reflect.Method.invoke(Method.java:511)
09-24 18:40:08.925: D/VM Util(24228): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
09-24 18:40:08.925: D/VM Util(24228): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
09-24 18:40:08.925: D/VM Util(24228): at dalvik.system.NativeStart.main(Native Method)
Any pointers will be really helpful.
EDIT The test device is Samsung Galaxy S3 GT-I9300. The camera in the native application works fine.
What i am trying to do is to use the camera library in a cross-platform tool called Kony. Kony compiles and integrates the library without any issues. But while launching the camera, i am seeing this issue.
May i know the probable conditions at which the Camera fails to load.
I am trying to launch the MainActivity in the CameraDemo-V9 sample as below
Intent myIntent = new Intent(CamTestActivity.this, com.commonsware.cwac.camera.acl.demo.MainActivity.class);
this.startActivity(myIntent);
This sample is working expected in a Android native project.
-- Thanks, Sunil