title: Android: Is a while loop efficient?
body: <p>Currently I'm using the following construction:</p>
  
  <pre><code>while(continue)
  {
      if(somethingChanged)
      {
          draw();
      }
  }
  </code></pre>
  
  <p>Is this way of waiting efficient, or is there a better way to do this?</p>
  
  <p>--</p>
  
  <p>As requested, more info:</p>
  
  <p>I'm drawing on a SurfaceView, with a Thread locking the Canvas and calling the onDraw(Canvas) method. When the thing I have drawn hasn't changed, I don't need to call the onDraw(Canvas) method, so I keep a boolean somethingChanged.</p>
  
  <p>Also, when I touch the screen, I draw let's say a circle at the point of touch, so when I'm touching the screen, somethingChanged is true.</p>