title: Getting options menu to do an action
body: <p>I made a an options menu and am trying to get the buttons like save and open to be able to work and save the files to the internal storage on the device.  When i put in the code to do it it says that open and save cannot be applied.  Also its giving me an error saying that it needs an intent but im giving it a menuitem.  How would i go about making this an intent and fixing it? Here is my code.</p>
  
  <pre><code>import android.app.ActionBar;
  import android.app.Activity;
  import android.content.res.Resources;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v7.app.ActionBarActivity;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.Toast;
  
  import java.io.BufferedReader;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.OutputStreamWriter;
  
  import static com.exaple.josh.unidrive.R.id.help;
  import static com.exaple.josh.unidrive.R.id.list_item;
  import static com.exaple.josh.unidrive.R.id.open;
  import static com.exaple.josh.unidrive.R.id.save;
  </code></pre>
  
  <p>/**
   * Created by Josh on 1/31/2015.
   */</p>
  
  <pre><code>public class Documents extends ActionBarActivity {
  
  @Nullable
  @Override
  public ActionBar getActionBar() {
      return super.getActionBar();
          }
  
  EditText et;
  EditText txtView;
  private String data;
  private String file = "mydata";
  
  private Menu menuresource;
  
  
  public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.menuresource, (android.view.Menu) menu);
      return true;
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.documents);
  }
  @Override
  public boolean onOptionsItemSelected(Menu item) {
      // Handle presses on the action bar items
      switch (item.getItem(Menu.CATEGORY_ALTERNATIVE)) {
          case Save():
              showToast("Save Clicked");
              return true;
          case Open():
              showToast("Open Clicked");
              return true;
          return super.onOptionsItemSelected((MenuItem) item);
  
      }
  }
  
  
  public void showToast(String message) {
      Toast toast=Toast.makeText(getApplicationContext(),message, Toast.LENGTH_SHORT);
      toast.show();
  }
  </code></pre>