title: Android. Reload Webview
body: <p>I want to use <strong>window.loadUrl("Javascript:window.location.reload( true )");</strong> to reload a webview but can't get it to perform. May I get some advice or alternative solution? I simply want the button <strong>reload</strong> to reload the webview <strong>window</strong></p>
  
  <p>Thank you,
  Java below:</p>
  
  <pre><code>   package com.fortunecaster.android;
  
      import android.app.Activity;
      import android.os.Bundle;
      import android.view.View;
      import android.webkit.WebChromeClient;
      import android.webkit.WebView;
      import android.webkit.WebViewClient;
      import android.widget.Button;
  
      public class FcastActivity extends Activity { 
  
      WebView window;
      Button reload;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_fcast);
  
          window = (WebView)findViewById(R.id.webView1);
          window.getSettings().setJavaScriptEnabled(true);
          window.getSettings().setLoadWithOverviewMode(true);
          window.getSettings().setUseWideViewPort(true);
          window.setWebViewClient(new WebViewClient());
          window.setWebChromeClient(new WebChromeClient());
          window.getSettings().setAppCacheEnabled(true);
  
  
          try {
          window.loadUrl("http://www.fortunecaster.com/android-td");
          } catch (Exception e) {
              e.printStackTrace();
  
              //setup button
              reload = (Button)findViewById(R.id.button1);
              //set onClickListener
              reload.setOnClickListener(new View.OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      window.loadUrl("Javascript:window.location.reload( true )");
  
                      // TODO Auto-generated method stub
  
                  }
              });
        }
  }
  </code></pre>