title: Android: how to create delay in loop while still updating the UI
body: <p>This is my first post here so sorry if I don't format my question correctly.
  I am developing my first Android app and it is a card game. I've developed the same card game in C# using visual studio. In C#, in order to simulate action and delay when dealing, etc, I slept the thread for a given amount of time, then called the method Application.DoEvents() which forced the UI to update. However, in java, I cannot seem to find an answer to this problem. </p>
  
  <p>I'll post some code from my deal() method, which I need to delay so it looks like the cards are actually being dealt in a circle, and not all at once since the computer goes so fast:</p>
  
  <p>private void dealHelper()
      {
          Hand pCards = Referee.getHumanHand();</p>
  
  <pre><code>    //show all cards in rotating order
      for(int i=0; i&lt;CARD_COUNT; i++)
      {
          ///////////////////////////////////////////////////////////////////////
          // load each card into their appropriate ImageViews and make visible //
          ///////////////////////////////////////////////////////////////////////
  
          //human player
          LoadCard(playerCards.get(i), pCards.getCard(i));
          playerCards.get(i).setVisibility(View.VISIBLE);
          playerCards.get(i).setPadding(1, 1, 1, 1);
  
          // allow discarded cards to be clickable
          discardCardImages.get(i).setPadding(1, 1, 1, 1);
  
          //computer 1
          computer1Cards.get(i).setImageResource(R.drawable.cardskin);
          computer1Cards.get(i).setVisibility(View.VISIBLE);
  
          //computer 2
          computer2Cards.get(i).setImageResource(R.drawable.cardskin);
          computer2Cards.get(i).setVisibility(View.VISIBLE);
  
          //computer 3
          computer3Cards.get(i).setImageResource(R.drawable.cardskin);
          computer3Cards.get(i).setVisibility(View.VISIBLE);
      }
  }
  </code></pre>
  
  <p>I need a slight delay of about 500ms between each card that is displayed on the screen to simulate action. I've searched and searched and haven't a solution that works (or I understand). Any help would be much appreciated. </p>
  
  <p>Thank You,
  Daniel</p>