title: Splash loading skipped transition animation
body: <p>I'm new in android programming, and here i try to create some splash screen with 3 different images showing up one after another using RunOnUIThread, here's the code </p>
  
  <p><strong>Splash.java</strong></p>
  
  <pre><code>public class Splash extends Activity {
  
  int loading_count;
  int imgShowed = 1;
  ImageView img1, img2;
  ImageSwitcher imgSwitcher;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.splash);
  
      img1 = (ImageView)findViewById(R.id.img01);
      img2 = (ImageView)findViewById(R.id.img02);
      imgSwitcher = (ImageSwitcher)findViewById(R.id.splash_switcher);
  
      LoadingThread();
  }
  
  private void LoadingThread(){
      Thread loading = new Thread(){
          @Override
          public void run(){
              try{
              //=================================//
              //   Looping for splash loading    //
              //=================================//
                  while(loading_count &lt; 170){
                      sleep(50);
                      runOnUiThread(new Runnable(){
                          @Override
                          public void run() {
                              if(loading_count &gt;=20){
                                  if(imgShowed == 1){
                                      imgSwitcher.showNext();
                                      imgShowed = 2;
                                  }
                              }if(loading_count &gt;= 70){
                                  if(imgShowed == 2){
                                      img1.setImageResource(R.drawable.two);
                                      imgSwitcher.showNext();
                                      imgShowed = 3;
                                  }
                              }if(loading_count &gt;= 120){
                                  if(imgShowed == 3){
                                      img2.setImageResource(R.drawable.three);
                                      imgSwitcher.showNext();
                                      imgShowed = 4;
                                  }
                              }
                              loading_count += 1;
                          }
                      });
                  }
              }catch(InterruptedException e){
                  e.printStackTrace();
              }finally{
                  StartMainMenu();
              }
          }
      };
      loading.start();
  }
  
  private void StartMainMenu(){
      Intent mainmenu = new Intent(this, MainMenu.class);
      finish();
      startActivity(mainmenu);
      overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
  }
  </code></pre>
  
  <p><strong>Layout.xml</strong></p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:background="#000000" &gt;
  
      &lt;ImageSwitcher 
          android:id="@+id/splash_switcher"
          android:layout_centerInParent="true"
          android:layout_width="200dp"
          android:layout_height="200dp"
          android:background="#00000000"
          android:inAnimation="@anim/fade_in"
          android:outAnimation="@anim/fade_out"
          &gt;
  
          &lt;ImageView 
              android:id="@+id/img01"
              android:layout_height="200dp"
              android:layout_width="200dp"
              android:scaleType="fitXY"
              android:background="#000000"
              android:contentDescription="@string/app_name"
              /&gt;
  
          &lt;ImageView 
              android:id="@+id/img02"
              android:layout_height="200dp"
              android:layout_width="200dp"
              android:scaleType="fitXY"
              android:background="@drawable/one"
              android:contentDescription="@string/app_name"
              /&gt;
  
      &lt;/ImageSwitcher&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>after executing it on android emulator, i got message in logcat says it's skipped 42 frames because application doing too much work on it's main thread and the transition animation didn't work as i intended.. did i do something wrong in the thread? please guide me through with an explanation.</p>