title: How to remove white screen while loading android application?
body: <p>I am new to android. I have a web view which loads a URL. The problem is that after I open the application there is a white screen for 2-3 seconds after that the web view‘s URL is loaded. </p>
  
  <p>I think this is the time the application Initiates.  How can I remove the white screen and display my Logo for that time? 
  I heard of splash screen but in that the logo appears for 1 second then white screen appears for another 2-3 seconds and then finally the web view is loaded. </p>
  
  <p>What am I doing wrong? Is it splash screen or some other way to display the logo while web view loads? </p>
  
  <pre><code>package com.exampe.dating;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.view.KeyEvent;
  import android.view.Menu;
  import android.webkit.WebSettings;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          WebView mywebview = (WebView) findViewById(R.id.webview);
           mywebview.loadUrl("http://www.example.com/mobile/index.php");
           WebSettings webSettings = mywebview.getSettings();
           webSettings.setJavaScriptEnabled(true);
           mywebview.setWebViewClient(new WebViewClient());
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  
      @Override
      public boolean onKeyDown(int keyCode, KeyEvent event) {
          WebView mywebview = (WebView) findViewById(R.id.webview);
          if ((keyCode == KeyEvent.KEYCODE_BACK) &amp;&amp; mywebview.canGoBack()) {
              mywebview.goBack();
              return true;
          }
          return super.onKeyDown(keyCode, event);
      }
  }
  </code></pre>
  
  <p>splashActivity.java</p>
  
  <pre><code>package com.exampe.dating;
  
  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 = 10;    // 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.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>androidManifest</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.exampe.dating"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="8" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt; 
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
           &lt;activity
           android:name=".SplashActivity"&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="com.exampe.dating.MainActivity"
              android:label="@string/app_name"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"  &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>