title: My splash screen ends too early. How can I manually hide a splash screen on Android?
body: <p>I have created a splash screen theme for my Android game. But the problem is that my splash screen automatically ends after OnCreate(Bundle bundle) was fully executed and this results in a black screen before Draw(GameTime gameTime) is executed. I draw my game's sprites in Draw(GameTime gameTime). Therefore, there is a black screen until Draw(GameTime gameTime) is executed.</p>
  <p>Is it possible to manually end the splash screen when my game code has already reached Draw(GameTime gameTime)? I don't want that the splash screen already ends when OnCreate(Bundle bundle) was fully executed.</p>
  <p>splash_screen_svg.xml:</p>
  <pre><code>&lt;vector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:width=&quot;320dp&quot;
  android:height=&quot;480dp&quot;
  android:viewportWidth=&quot;84.666664&quot;
  android:viewportHeight=&quot;127&quot;&gt;
  &lt;path
    android:pathData=&quot;M0.529,0.529h83.608v125.942h-83.608z&quot;
    android:strokeWidth=&quot;1.05833&quot;
    android:fillColor=&quot;#00ffff&quot;
    android:strokeColor=&quot;#000000&quot;/&gt;
  &lt;path
    android:pathData=&quot;M21.431,32.015h41.804v62.971h-41.804z&quot;
    android:strokeWidth=&quot;0.529167&quot;
    android:fillColor=&quot;#ff0000&quot;
    android:strokeColor=&quot;#000000&quot;/&gt;
  &lt;/vector&gt;
  </code></pre>
  <p>colors.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
  &lt;resources&gt;
    &lt;color name=&quot;splash_background&quot;&gt;#eff1f7&lt;/color&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>Strings.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;resources&gt;
    &lt;string name=&quot;app_name&quot;&gt;splashapp&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>styles.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
  &lt;resources&gt;
   &lt;style name=&quot;MainTheme&quot; parent=&quot;MainTheme.Base&quot;&gt;
  &lt;/style&gt;
  &lt;!-- Base theme applied no matter what API --&gt;
  &lt;style name=&quot;MainTheme.Base&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
      &lt;!--If you are using revision 22.1 please use just windowNoTitle. Without android:--&gt;
      &lt;item name=&quot;android:windowNoTitle&quot;&gt;true&lt;/item&gt;
      &lt;!--We will be using the toolbar so no need to show ActionBar--&gt;
      &lt;item name=&quot;android:windowActionBar&quot;&gt;false&lt;/item&gt;
       &lt;item name=&quot;android:windowFullscreen&quot;&gt;true&lt;/item&gt;
      &lt;!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette --&gt;
      &lt;!-- colorPrimary is used for the default action bar background --&gt;
      &lt;item name=&quot;android:colorPrimary&quot;&gt;#2196F3&lt;/item&gt;
      &lt;!-- colorPrimaryDark is used for the status bar --&gt;
      &lt;item name=&quot;android:colorPrimaryDark&quot;&gt;#1976D2&lt;/item&gt;
      &lt;!-- colorAccent is used as the default value for colorControlActivated
       which is used to tint widgets --&gt;
      &lt;item name=&quot;android:colorAccent&quot;&gt;#FF4081&lt;/item&gt;
      &lt;!-- You can also set colorControlNormal, colorControlActivated
       colorControlHighlight and colorSwitchThumbNormal. --&gt;
      &lt;item name=&quot;android:windowActionModeOverlay&quot;&gt;true&lt;/item&gt;
      &lt;item name=&quot;android:windowIsTranslucent&quot;&gt;true&lt;/item&gt;
  &lt;/style&gt;
  &lt;style name=&quot;SplashTheme&quot; parent =&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
  &lt;item name=&quot;android:windowBackground&quot;&gt;@drawable/splash_screen_svg&lt;/item&gt;
  &lt;item name=&quot;android:windowNoTitle&quot;&gt;true&lt;/item&gt;
  &lt;item name=&quot;android:windowActionBar&quot;&gt;false&lt;/item&gt;
  &lt;item name=&quot;android:windowFullscreen&quot;&gt;true&lt;/item&gt;
  &lt;item name=&quot;android:windowContentOverlay&quot;&gt;@null&lt;/item&gt;
  &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>Activity1.cs:</p>
  <pre><code>namespace splashapp
  {
  [Activity(
      Label = &quot;@string/app_name&quot;,
      MainLauncher = true,
      Theme = &quot;@style/SplashTheme&quot;,
      Icon = &quot;@drawable/icon&quot;,
      AlwaysRetainTaskState = true,
      LaunchMode = LaunchMode.SingleInstance,
      ScreenOrientation = ScreenOrientation.FullUser,
      ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
  )]
  public class Activity1 : AndroidGameActivity
  {
      private Game1 _game;
      private View _view;
  
      protected override void OnCreate(Bundle bundle)
      {
          base.SetTheme(Resource.Style.MainTheme);
          base.OnCreate(bundle);
          _game = new Game1();
          _view = _game.Services.GetService(typeof(View)) as View;
          SetContentView(_view);
          _game.Run();
      }
  }
  }
  </code></pre>
  <p>Game1.cs:</p>
  <pre><code>namespace splashapp
  {
  public class Game1 : Game
  {
      private GraphicsDeviceManager _graphics;
      private SpriteBatch _spriteBatch;
  
      public Game1()
      {
          _graphics = new GraphicsDeviceManager(this);
          Content.RootDirectory = &quot;Content&quot;;
      }
  
      protected override void Initialize()
      {
          base.Initialize();
      }
  
      protected override void LoadContent()
      {
          _spriteBatch = new SpriteBatch(GraphicsDevice);
          
          // TODO: use this.Content to load your game content here
      }
  
      protected override void Update(GameTime gameTime)
      {
          // TODO: Add your update logic here
  
          base.Update(gameTime);
      }
  
      protected override void Draw(GameTime gameTime)
      {
          GraphicsDevice.Clear(Color.CornflowerBlue);
  
          // TODO: Add your drawing code here
  
          base.Draw(gameTime);
      }
  }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/aEACG.png" rel="nofollow noreferrer">My solution picture</a></p>