title: Android Program crahses on start
body: <p>I have been following <a href="https://www3.ntu.edu.sg/home/ehchua/programming/android/Android_3D.html" rel="nofollow">this</a> series on Open GL for android, but whenever I run the first program it crashes on start. I might have missed something in their code, but I triple checked. does it have something to do with the activity xml file?</p>
  
  <p>here is the complete log cat info</p>
  
  <pre><code>04-20 15:53:13.695: D/OpenGLRenderer(2229): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
  04-20 15:53:13.698: D/(2229): HostConnection::get() New Host Connection established 0xb42b3e10, tid 2229
  04-20 15:53:13.791: D/Atlas(2229): Validating map...
  04-20 15:53:13.844: D/(2229): HostConnection::get() New Host Connection established 0xb42b3eb0, tid 2245
  04-20 15:53:13.955: I/OpenGLRenderer(2229): Initialized EGL, version 1.4
  04-20 15:53:14.002: D/OpenGLRenderer(2229): Enabling debug mode 0
  04-20 15:53:14.025: W/EGL_emulation(2229): eglSurfaceAttrib not implemented
  04-20 15:53:14.025: W/OpenGLRenderer(2229): Failed to set EGL_SWAP_BEHAVIOR on surface 0xb431f980, error=EGL_SUCCESS
  04-20 15:53:14.119: D/(2229): HostConnection::get() New Host Connection established 0xb42b3ad0, tid 2244
  04-20 15:53:14.214: E/AndroidRuntime(2229): FATAL EXCEPTION: GLThread 157
  04-20 15:53:14.214: E/AndroidRuntime(2229): Process: com.test, PID: 2229
  04-20 15:53:14.214: E/AndroidRuntime(2229): java.lang.IllegalArgumentException: No config chosen
  04-20 15:53:14.214: E/AndroidRuntime(2229):     at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:869)
  04-20 15:53:14.214: E/AndroidRuntime(2229):     at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1023)
  04-20 15:53:14.214: E/AndroidRuntime(2229):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1400)
  04-20 15:53:14.214: E/AndroidRuntime(2229):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
  </code></pre>
  
  <p><strong>MyGLActivity.class</strong>   </p>
  
  <pre><code> package com.test;
  
      import android.support.v7.app.ActionBarActivity;
      import android.app.Activity;
      import android.os.Bundle;
      import android.opengl.*;
      import android.opengl.GLSurfaceView.Renderer;
      public class MyGLActivity extends Activity {
  
          private GLSurfaceView glView;
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              glView = new GLSurfaceView(this);
              glView.setRenderer(new MyGlRenderer(this));
              this.setContentView(glView);
          }
  
          @Override
          public void onPause(){
              super.onPause();
              glView.onPause();
          }
  
          @Override
          public void onResume(){
              super.onResume();
              glView.onResume();
          }
  
  
      }
  </code></pre>
  
  <p><strong>MyGlRenderer.class</strong></p>
  
  <pre><code>package com.test;
  import javax.microedition.khronos.egl.EGLConfig;
  import javax.microedition.khronos.opengles.GL10;
  import android.opengl.GLSurfaceView;
  import android.opengl.GLU;
  import android.content.Context;
  public class MyGlRenderer implements GLSurfaceView.Renderer{
      Context context;
  
      public  MyGlRenderer(Context context){
          this.context = context;
      }
  
      @Override
      public void onSurfaceCreated(GL10 gl,EGLConfig config){
          gl.glClearColor(100.0f,50.0f,75.0f,1.0f);
          gl.glClearDepthf(1.0f);
          gl.glEnable(GL10.GL_DEPTH_TEST);
          gl.glDepthFunc(GL10.GL_LEQUAL);
          gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
          gl.glShadeModel(GL10.GL_SMOOTH);
          gl.glDisable(GL10.GL_DITHER);
  
      }
  
      @Override
      public void onSurfaceChanged(GL10 gl, int width, int height) {
          if(height == 0){ height = 1;}
          float aspect = (float)width / height;
  
  
          gl.glViewport(0,0,width,height);
  
          gl.glMatrixMode(GL10.GL_PROJECTION);
          gl.glLoadIdentity();
  
          GLU.gluPerspective(gl, 45, aspect, 0.1f,100.f);
  
          gl.glMatrixMode(GL10.GL_MODELVIEW);
          gl.glLoadIdentity();
  
  
      }
  
      @Override
      public void onDrawFrame(GL10 gl) {
          gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  
  
      }
  
  }
  </code></pre>