title: Change Background Color of a Button in an Android Application
body: <p>I would like to change the background color of a button when I click it. My goal is that the color should be changed for 5 seconds and then change again to another color.</p>
  
  <p>The original color of the button is yellow.</p>
  
  <p>Here is a part of the code I have tried:</p>
  
  <pre><code>public void click(View view){
    myTestButton = (Button)view;
    myTestButton.setBackgroundColor(Color.BLUE);
    //*Wait lines;*
    myTestButton.setBackgroundColor(Color.RED);
  }
  </code></pre>
  
  <p>The button changes color to red but never to blue. I suspect that the view does not refresh until later. I want the button to be refreshed before the wait lines.
  I've also tried <code>myTestButton.invalidate()</code> but to no avail.</p>
  
  <p>Thanks in advance for some great tips on this!! </p>