I have the following class:
public class MyGLSurfaceView extends GLSurfaceView {
MyRenderer mRenderer;
public MyGLSurfaceView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
init();
}
I want to add the following constructor:
public MyGLSurfaceView(Context context, MyRenderer myRenderer) {
I tried:
public class MyGLSurfaceView extends GLSurfaceView {
MyRenderer mRenderer;
static AttributeSet attributeSet = null;
public MyGLSurfaceView(Context context, MyRenderer mRenderer) {
this.mRenderer = mRenderer;
this(context, attributeSet);
}
public MyGLSurfaceView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
init();
}
but it wont let me set the renderer before calling the default constructor of MyGLSurfaceView
.
How to set a variable before calling the default constructor?