title: Better way to update SurfaceView multiple times?
body: <p>I'm using a <code>SurfaceView</code> and I have to update it as fast as I can. Since the onDraw method isn't called automatically I have to call explicitly. So my first attempt was on threads, but I got some lag. There is a better way to do this? If there is a better solution, can you, please, explain me? I'm new on Android's World!</p>
  
  <hr>
  
  <p><strong>What I have so far</strong></p>
  
  <pre><code>public void run() {
      while(running){
          Canvas c = null;
          try {
              c = view.getHolder().lockCanvas();
              synchronized (view.getHolder()) {
                  view.onDraw(c);
              }
          } finally {
              if (c != null) {
                  view.getHolder().unlockCanvasAndPost(c);
              }
          }
      }
  }
  </code></pre>