title: make pause between drawing two draws
body: <p>I want to make a pause between drawing two draws. I've tried <code>Thread.sleep</code>, handlers, <code>asyncTask</code> and got same result - when activity starts up I must wait for a time that I set to see the first draw, only when I call same method (test) again, I see second draw instead of seeing first draw again. There's my code:</p>
  
  <pre><code>public void test(){
  button.setClickable(false);
  button.setBackgroundColor(Color.DKGRAY);
  view.setFromAtoB(true);
  view.invalidate();
  AsyncTask&lt;Void, Void, Void&gt; task = new AsyncTask&lt;Void, Void, Void&gt;() {
      @Override
      protected Void doInBackground(Void... params) {
          try {
              Thread.sleep(2000);
          } catch (InterruptedException e) {
              }
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          view.setMoveAB(true);
          view.postInvalidate();
          button.setBackgroundColor(Color.GRAY);
          button.setClickable(true);           
      }
  };
  task.execute((Void[])null);
  </code></pre>
  
  <p>Where's the problem? Why can't I see some kind of harmony, first draw, pause, second draw? :) Maybe I've blocked UI thread. For drawing I use canvas. In <code>onDraw</code> method I make some calculations and call <code>drawRodsAndDiscs</code> method:</p>
  
  <pre><code>private void drawRodsAndDiscs(Canvas canvas){
      Paint paint = new Paint();
      drawRods(canvas);
      paint.setColor(Color.GREEN);
      paint.setStyle(Paint.Style.STROKE);
      for (Rect disc : discs) {
          canvas.drawRect(disc, paint);
      } 
  }
  </code></pre>