Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Nullpointer when setting picture size parameter in Camera1 #72

Open
jaydeepw opened this issue Dec 21, 2016 · 1 comment
Open

Nullpointer when setting picture size parameter in Camera1 #72

jaydeepw opened this issue Dec 21, 2016 · 1 comment
Labels

Comments

@jaydeepw
Copy link

FATAL EXCEPTION: main
Process: com.google.android.cameraview.demo, PID: 5712
java.lang.NullPointerException
at com.google.android.cameraview.Camera1.adjustCameraParameters(Camera1.java: 320)
at com.google.android.cameraview.Camera1.setAspectRatio(Camera1.java: 164)
at com.google.android.cameraview.CameraView.setAspectRatio(CameraView.java: 332)
at com.google.android.cameraview.demo.MainActivity.onAspectRatioSelected(MainActivity.java: 221)
at com.google.android.cameraview.demo.AspectRatioFragment$1.onClick(AspectRatioFragment.java: 84)
at android.support.v7.app.AlertController$AlertParams$3.onItemClick(AlertController.java: 959)
at android.widget.AdapterView.performItemClick(AdapterView.java: 302)
at android.widget.AbsListView.performItemClick(AbsListView.java: 1196)
at android.widget.AbsListView$PerformClick.run(AbsListView.java: 3054)
at android.widget.AbsListView$3.run(AbsListView.java: 3812)
at android.os.Handler.handleCallback(Handler.java: 733)
at android.os.Handler.dispatchMessage(Handler.java: 95)
at android.os.Looper.loop(Looper.java: 136)
at android.app.ActivityThread.main(ActivityThread.java: 5590)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java: 515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 1280)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 1096)
at dalvik.system.NativeStart.main(Native Method)

@jamesbluecrow
Copy link

Some of our users have been experiencing this when opening the camera in a device Galaxy J3(2016 running Android 5.1.

The reason is that we try to access the last PictureSizes item for an AspectRatio and there is no such size for that aspect ratio.

In those case we should be defaulting to the PreviewSizes.

This PR adds that functionality: #207

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants