title: Android Webview: Why Doesn't Refresh Work In Options Menu?
body: <p>I've been racking my brains over this for ages, but think I'm too close to the woods to see the trees. Can anyone tell me why <em>item1</em> in the menu below doesn't work to refresh the webview? </p>
  
  <p>(The exit button (<em>item2</em>) works just fine, if that matters.)</p>
  
  <pre><code>package com.my.project;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.webkit.WebView;
  import android.view.View;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.Window;
  
  public class MyProjectActivity extends Activity
  {
      final Activity activity = this;
  
          public void onCreate(Bundle savedInstanceState) 
  
              {
                  super.onCreate(savedInstanceState);
                  getWindow().requestFeature(Window.FEATURE_NO_TITLE);
                  setContentView(R.layout.main);       
  
                  WebView WebView = (WebView) findViewById(R.id.webview);                         
                  WebView.getSettings().setJavaScriptEnabled(true);
                  WebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
                  WebView.loadUrl("http://www.mydomain.php");
              }   
  
          // Create Menu Buttons
          @Override
          public boolean onCreateOptionsMenu(Menu menu)
              {   
                  MenuInflater inflater = getMenuInflater();
                  inflater.inflate(R.menu.options_menu, menu);
                  return true;
              }
  
          // Set Menu Button Actions
          @Override
          public boolean onOptionsItemSelected(MenuItem item) 
              {
              switch (item.getItemId()) 
                  {
                      case R.id.item1:
                          reload();
                          return true;
                      case R.id.item2:     
                          finish();
                          return true;
                      default:
                          return super.onOptionsItemSelected(item);
                  }
              }
  }
  </code></pre>