title: Refresh button in action bar of android app
body: <p>i m very new into android app. I m trying to execute an app that should contain a refresh button in the action bar. While compiling a code, the studio is prompting this error</p>
  
  <p>"Error:(50, 20) error: non-static method reload() cannot be referenced from a static context"</p>
  
  <p>I have written this uptil now</p>
  
  <pre><code>import android.os.Bundle;
  import android.webkit.WebView;
  import android.widget.Toast;
  import android.webkit.WebViewClient;
  import android.app.Activity;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.Menu;
  
  
  public class MainActivity extends Activity {
  
  private WebView mWebView;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      mWebView = new WebView(this);
      mWebView.getSettings().setJavaScriptEnabled(true);
      final Activity activity = this;
      mWebView.setWebViewClient(new WebViewClient(){
  
          public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
              Toast.makeText(activity, description, Toast.LENGTH_SHORT).show();
          }
  
      });
  
      mWebView.loadUrl("http://www.example.com");
      setContentView(mWebView);
  
  }
  
  @Override
  public boolean onCreateOptionsMenu (Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.menu_main, menu);
      return super.onCreateOptionsMenu(menu);
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      if(item.getItemId() == R.id.action_refresh){
          WebView.reload();
          return true;
      }
      return super.onOptionsItemSelected(item);
   }
  }
  </code></pre>
  
  <p>menu_main.xml </p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"      tools:context=".MainActivity"&gt;
  &lt;item android:id="@+id/action_settings" android:title="@string/action_settings"
      android:orderInCategory="100" app:showAsAction="never" /&gt;
  
   &lt;item
      android:id="@+id/action_refresh"
      android:title="@string/refresh_button"
      android:icon="@drawable/ic_action_refresh"
      android:orderInCategory="1"
      app:showAsAction="never"
      /&gt;
  
  &lt;/menu&gt;
  </code></pre>