title: Android sleep() without blocking UI
body: <p>For my new Android application I need a function, that timeout my application for 3 Seconds. I tried the function "sleep()" like this:</p>
  
  <pre><code>seekBar1.setProgress(50);                // Set something for my SeekBar
  
  try{
     Thread.sleep(3000);                   // Wait for 3 Seconds
  } catch (Exception e){
     System.out.println("Error: "+e);      // Catch the exception
  }
  
  button.setEnabled(true);                 // Enable my button
  </code></pre>
  
  <p>It seems to work, but if I was running the application it does it like this: Wait for 3 Seconds, set progress and enable button. I want first to set the progress and then wait for 3 seconds and only then to enable the button.</p>
  
  <p>Is "sleep()" for the right for my use or what can I do else that my application does it in the right order?</p>