title: How to set a message in a Splash Screen Android
body: <p>I want to create a SplashActivity in my application that shows "Loading..." like a texview, in the middle of the screen. A message, not an image :)</p>
  
  <p>Here is the activity:</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Window;
  import android.view.WindowManager;
  
  public class SplashActivity extends Activity {
  
  private static String TAG = SplashActivity.class.getName();
  private static long SLEEP_TIME = 5;    // Sleep for some time
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
  
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);    // Removes title bar
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);    // Removes notification bar
  
    setContentView(R.layout.activity_splash);
  
    // Start timer and launch main activity
    IntentLauncher launcher = new IntentLauncher();
    launcher.start();
   }
  
   private class IntentLauncher extends Thread {
    @Override
    /**
     * Sleep for some time and than start new activity.
     */
    public void run() {
       try {
          // Sleeping
          Thread.sleep(SLEEP_TIME*1000);
  
       } catch (Exception e) {
          Log.e(TAG, e.getMessage());
       }
  
       // Start main activity
       Intent intent = new Intent(SplashActivity.this, MainActivity.class);
       SplashActivity.this.startActivity(intent);
       SplashActivity.this.finish();
    }
   }
  }
  </code></pre>
  
  <p>And here is the XML code:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".SplashActivity" &gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Can anybody help me?</p>