title: How to fill progress bar in a specific amount of time?
body: <p>I have the following splash screen for my app:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;#000000&quot;
      &gt;
  
      &lt;ImageView
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:id=&quot;@+id/imageView&quot;
          android:src = &quot;@drawable/timer_ic&quot;
          android:layout_centerInParent=&quot;true&quot; /&gt;
  
      &lt;TextView
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:textAppearance=&quot;?android:attr/textAppearanceLarge&quot;
          android:text=&quot;Timer&quot;
          android:textColor=&quot;#FFFFFF&quot;
          android:id=&quot;@+id/textView&quot;
          android:layout_above=&quot;@+id/imageView&quot;
          android:layout_centerHorizontal=&quot;true&quot;
          android:layout_marginBottom=&quot;51dp&quot; /&gt;
  
      &lt;ProgressBar
          android:id=&quot;@+id/progress_bar&quot;
          style=&quot;@android:style/Widget.ProgressBar.Horizontal&quot;
          android:layout_width=&quot;250sp&quot;
          android:layout_height=&quot;5sp&quot;
          android:progress=&quot;1&quot;
          android:layout_marginTop=&quot;82dp&quot;
          android:max=&quot;3&quot;
          android:indeterminate=&quot;false&quot;
          android:layout_below=&quot;@+id/imageView&quot;
          android:layout_centerHorizontal=&quot;true&quot;
          android:progressDrawable=&quot;@drawable/custom_progress_bar&quot;
          android:background=&quot;#808080&quot;/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>The splash screen runs for 3 seconds before moving onto the next activity, which is controlled by this piece of code:</p>
  <pre><code>package com.awesomeapps.misael.timer;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.graphics.Color;
  import android.os.Bundle;
  import android.widget.ProgressBar;
  
  
  public class SplashScreen extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.splash);
  
          Thread timer = new Thread(){
              public void run(){
                  try{
                      sleep(3000);
                  }catch(InterruptedException e){
                      e.printStackTrace();
                  }finally{
                      Intent openMainActivity= new Intent(&quot;com.awesomeapps.timer.MAINACTIVITY&quot;);
                      startActivity(openMainActivity);
                  }
              }
          };
          timer.start();
      }
  
      @Override
      protected void onPause() {
          // TODO Auto-generated method stub
          super.onPause();
          finish();
      }
  
  }
  </code></pre>
  <p>Like I said and as you can see the splash screeb runs for 3 seconds (3000 milliseconds). You may also notice that the splash screen has a progress bar.</p>
  <p>My question is:</p>
  <p><strong>How can I fill/load the progress bad in those 3 seconds that my splash screen is running?</strong></p>
  <p>I guess to give my app that sort of loading effect when it first starts by filling the progress bar.</p>
  <p>Is it possible to do this?</p>