surfaceview + glsurfaceview + framelayout

后端 未结 4 1538
傲寒
傲寒 2021-02-04 14:07

I\'m new at java and OpenGL.

I\'m trying to get a camera preview screen with the ability to display 3d objects simultaneously. Having gone through the samples at the a

4条回答
  •  悲&欢浪女
    2021-02-04 14:38

    the reason you are getting a null pointer exception when working with .xml is because ur actually creating new Views in your java code.. instead of using the ones from the .xml file to which you might have passed in properties(if u did pass in properties that is..).. the new View would obviously have a null value.. thus throwing a null pointer exception... for example --

    cubesView = new GLSurfaceView(this);

    is actually not needed in the code if you already created the View in the .xml file containing FrameLayout..

提交回复
热议问题