title: Android change Activity after few seconds
body: <p>I need some help with my first Android project.
  I want to write a app which is showing you a picture with a ImageView for a few seconds I would say so about 4 seconds and after that it change to a second activity which shows a button(only for testing).</p>
  
  <p>My Problem is that my app after I started it in my AVD jump over the picture and shows immediately the button. </p>
  
  <p>How can I fix it? I looked up so long and tried so many things I hope someone of you have a idea :)</p>
  
  <p>Thanks for helping</p>
  
  <p>Here my Code of my MainActivity:</p>
  
  <pre><code>     package com.example.parkourspots;
   public class MainActivity extends Activity {
  
  private ViewTreeObserver vto;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      final View myLayout = findViewById(R.id.startscreen);
  
      vto = myLayout.getViewTreeObserver();
  
  
  
      vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener(){
  
          @Override
          public void onGlobalLayout(){
              try {
                  Thread.sleep(500);
              } catch (InterruptedException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
              Intent intent = new Intent(MainActivity.this, select_activity_class.class);
  
              startActivity(intent);
  
  
      }
  }); 
  
  
  }}
  </code></pre>