title: Android: splash screen and webview
body: <p>I've trying for days now to get a solution to show a splash screen while loading a webview.</p>
  
  <p>I've looked around and there are several approaches: 
  - make activity just to show splash screen, wait a few seconds and then start the webview activity -> this is not a solution since all the loading is again done after splash screen is closed</p>
  
  <ul>
  <li><p>second approach is something like this: </p>
  
  <pre><code>   myWebView = (WebView) findViewById(R.id.webview);
  myWebView.getSettings().setJavaScriptEnabled(true);
  myWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 
  myWebView.setWebViewClient(new WebViewClient() {
     public void onPageFinished(WebView view, String url) {
         findViewById(R.id.webview).setVisibility(View.VISIBLE);
  
         //hide loading image
         findViewById(R.id.imageView1).setVisibility(View.GONE);
         //show webview
        }
      });
  </code></pre>
  
  <p>This works, but again there is a slight appearance of a white screen while transitioning to webview. And also you can't control the timing of your splash screen. </p></li>
  <li><p>third solution is something that I'd like to make, but (even after few days of searching and trying) don't know how -> show splash screen in one thread, prepare everything for a webview in another and then simply switch to webview. </p></li>
  </ul>
  
  <p>My question is, can anybody show me where to start with this third solution?</p>
  
  <ul>
  <li>I wanted to try something like <a href="https://stackoverflow.com/questions/6592091/android-preload-a-url-into-webview-while-splashscreen-is-showing">this</a>! but I couldn't figure out how to pass webview to another activity and from what I read, this is not even a good idea. </li>
  </ul>
  
  <p>Any suggestion, ideas, pointers? Is there a way to show splash screen, prepare(inflate) webview in another thread and then switch to it after loading url (and everything else) is done? </p>
  
  <p>Thanks!!!</p>