title: libgdx & kryonet: threads
body: <p>I try to develop a game for Android platform, using Libgdx library.
  For network, I use the Kryonet library.  </p>
  
  <p>I want to change screen when I'm sure that my application is connected to my server.<br>
  The network part seems work but I have a problem with threads: it's the Kryonet's thread which execute OpenGL, not the Libgdx thread:</p>
  
  <pre><code>public class MyGdxGame extends Game {
      public static int UDP_PORT = 55555, TCP_PORT = 55556;
      private Client client;
  
      @Override
      public void create() {
          /*
           * client connection
           * etc ...
           */
          client.addListener(new Listener() {
              private int nb = 0;
  
              @Override
              public void received(Connection connection, Object data) {
                  super.received(connection, data);
                  nb++;
                  if (nb == 5) {
                      MyGdxGame.this.setSecondScreen();
                  }
              }
          });
          setScreen(new First(this, client));
      }
  
      protected void setSecondScreen() {
          setScreen(new Second(this, client)); //This part should be executed by Libgdx thread ?!     
      }
  </code></pre>
  
  <p>Note that <em>First</em> and <em>Second</em> are both Screen class which just draw an image.</p>
  
  <p>I have this exception when I try to launch <em>Second</em> Screen:
  Exception in thread "<strong>Client</strong>" java.lang.RuntimeException: No OpenGL context found in the current thread.</p>
  
  <p>Can I force the LibGDX thread to execute instructions ?
  Is an other approach possible?</p>
  
  <p>Thank's
  Jonathan</p>