title: Android: Splash screen not showing
body: <p>So I am trying to get a splash screen to work, but I can't figure something out. I get a white screen during the splash screen even though it should be a different color and contain text. Here is my manifest file:</p>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.haas.ryan.bouncingball"&gt;
  
      &lt;!-- Gives permission to create directories and files --&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_E
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/bb_logo"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".splash.SplashActivity"
              android:screenOrientation="userLandscape"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".bbsource.MainActivity"
              android:screenOrientation="userLandscape"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN"/&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Here are my 2 Splash screen related classes:</p>
  
  <p><strong>SplashActivity.java</strong></p>
  
  <pre><code>package com.haas.ryan.bouncingball.splash;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.Window;
  import android.view.WindowManager;
  
  import com.haas.ryan.bouncingball.bbsource.MainActivity;
  
  public class SplashActivity extends Activity {
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          setContentView(new SplashEnvironment(this, this));
      }
  
      public void finish() {
          startActivity(new Intent(this, MainActivity.class));
          super.finish();
      }
  }
  </code></pre>
  
  <p><strong>SplashEnvironment.java</strong></p>
  
  <pre><code>package com.haas.ryan.bouncingball.splash;
  
  import android.app.Activity;
  import android.content.Context;
  import android.graphics.Canvas;
  import android.graphics.Color;
  import android.graphics.Paint;
  import android.view.SurfaceHolder;
  import android.view.SurfaceView;
  
  /**
   * Created by Ryan on 7/31/2017.
   */
  
  public class SplashEnvironment extends SurfaceView implements SurfaceHolder.Callback {
      private SplashActivity splashActivity;
  
      public SplashEnvironment(Context context, SplashActivity splashActivity) {
          super(context);
          this.splashActivity = splashActivity;
          getHolder().addCallback(this);
      }
  
      public void surfaceCreated(SurfaceHolder sh) {
          try {
              Thread.sleep(10000);
          } catch(Exception e) {
              e.printStackTrace();
          }
          splashActivity.finish();
      }
      public void surfaceDestroyed(SurfaceHolder sh) {}
      public void surfaceChanged(SurfaceHolder sh, int format, int width, int height) {}
  
      public void onDraw(Canvas canvas) {
          draw(canvas);
      }
  
      public void draw(Canvas canvas) {
          super.draw(canvas);
          canvas.drawColor(Color.RED);
          System.out.println("got here");
          Paint paint = new Paint();
          paint.setColor(Color.BLUE);
          paint.setTextSize(40f * getResources().getDisplayMetrics().density);
          canvas.drawText("SPLASH SCREEN", 100, 100, paint);
      }
  }
  </code></pre>
  
  <p>The white screen goes away after the duration and eventually loads <code>bbsource.MainActivity</code> and draws everything that it is supposed to.</p>
  
  <p>So why am I getting a white screen when I clearly tell it to draw other things?</p>