使用自定义GlSurfaceView执行Cast Execption

时间:2017-01-09 12:54:57

标签: java android classcastexception glsurfaceview

大家好我以这种方式宣布了一个自定义的GlSurfaceView

public class Render extends GLSurfaceView implements GLSurfaceView.Renderer {

在另一个类中我使用:

初始化它
render= (Render) view.findViewById(R.id.gl);

但在运行时,vm会生成此execption

java.lang.ClassCastException: android.opengl.GLSurfaceView cannot be cast to com.pugtests.depugscompany.openglprove.Render
为什么?任何人都可以向我解释我的错误并帮助我解决它...对不起我的英语并感谢大家。

0 个答案:

没有答案