-
Notifications
You must be signed in to change notification settings - Fork 1k
java.lang.NullPointerException on samsung SM-G9550 #257
Comments
Same on Samsung Galaxy A8 SM-A530F It happens because CameraView stop called earlier then unlockFocus |
how to solve it |
I don't look for reason of that.. You need to delay cameraview stop. The straight-forward solution is simply call stop (that you do after cameraview captured image) with delay like It's fast but ugly solution. |
After samsung's camera is called, the system will call ondestroy and the activity will be destroyed and rebuilt, because the system calls a horizontal and vertical switch
You can try this |
anyone has the final solution? we meet it on HUAWEI 8.0.0 phone |
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.hardware.camera2.CameraCaptureSession.capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession$CaptureCallback, android.os.Handler)' on a null object reference
at com.google.android.cameraview.Camera2.unlockFocus(TbsSdkJava:662)
at com.google.android.cameraview.Camera2$6.onCaptureCompleted(TbsSdkJava:646)
at java.lang.reflect.Method.invoke(Native Method)
at android.hardware.camera2.dispatch.InvokeDispatcher.dispatch(InvokeDispatcher.java)
at android.hardware.camera2.dispatch.HandlerDispatcher$1.run(HandlerDispatcher.java)
at android.os.Handler.handleCallback(Handler.java)
at android.os.Handler.dispatchMessage(Handler.java)
at android.os.Looper.loop(Looper.java)
at android.app.ActivityThread.main(ActivityThread.java)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
The text was updated successfully, but these errors were encountered: