Zoom In & Out Custom Camera - Null Pointer Exception

后端 未结 2 2034
星月不相逢
星月不相逢 2021-01-14 10:57

I am trying to Implement Zoom In & Out functionality in my Custom Camera.

    NullPointerException: zoomControls.setVisibility(View.GONE);
2条回答
  •  失恋的感觉
    2021-01-14 11:41

    In your code, params isn't ever initialized, thus its value is always null. This will result in a NullPointerException if you try to use a method on the null object. Perhaps in your constructor you should initialize it with the following:

    params = mCamera.getParameters();
    

提交回复
热议问题