Camera crashes in android 4.1(API level 16)

Posted by Lincy on Stack Overflow See other posts from Stack Overflow or by Lincy
Published on 2012-12-07T05:01:35Z Indexed on 2012/12/07 5:03 UTC
Read the original article Hit count: 124

Filed under:
|
|

My application has a camera functionality. It works fine in all Android version but now when i tested in S3 it crashes. The error points to this line:

Parameters parameters = mCamera.getParameters();

Could someone provide a solution for this? The log is below:

?:??: W/?(?): java.lang.NullPointerException
?:??: W/?(?):   at com.stpl.snapshun.camera.CameraActivity.surfaceChanged(CameraActivity.java:313)
?:??: W/?(?):   at android.view.SurfaceView.updateWindow(SurfaceView.java:554)
?:??: W/?(?):   at android.view.SurfaceView.access$000(SurfaceView.java:81)
?:??: W/?(?):   at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
?:??: W/?(?):   at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:671)
?:??: W/?(?):   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1818)
?:??: W/?(?):   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
?:??: W/?(?):   at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
?:??: W/?(?):   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
?:??: W/?(?):   at android.view.Choreographer.doCallbacks(Choreographer.java:555)
?:??: W/?(?):   at android.view.Choreographer.doFrame(Choreographer.java:525)
?:??: W/?(?):   at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
?:??: W/?(?):   at android.os.Handler.handleCallback(Handler.java:615)
?:??: W/?(?):   at android.os.Handler.dispatchMessage(Handler.java:92)
?:??: W/?(?):   at android.os.Looper.loop(Looper.java:137)
?:??: W/?(?):   at android.app.ActivityThread.main(ActivityThread.java:4745)
?:??: W/?(?):   at java.lang.reflect.Method.invokeNative(Native Method)
?:??: W/?(?):   at java.lang.reflect.Method.invoke(Method.java:511)
?:??: W/?(?):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
?:??: W/?(?):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
?:??: W/?(?):   at dalvik.system.NativeStart.main(Native Method)

Thanks in advance

© Stack Overflow or respective owner

Related posts about android

Related posts about camera