title: How to share action bar and items on it between activities
body: <p>This is probably extremely simple, but I have two activities that both need the same items in the action bar, but when I start the second activity (the first is main) the action overflow menu disappears. I understand that the action bar is unique to the activity its created in, but I want to know how to use the same action bar in various activities. Thanks</p>
  
  <p>Edit: here is some code that might help with my second issue of action bar items not working out of the first activity:
      package com.example.wfhsregistry;</p>
  
  <pre><code>import android.app.Activity;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  
  public class MenuActivity extends Activity{
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          MenuInflater inflater = getMenuInflater();
  
          inflater.inflate(R.menu.main, menu);
  
          return super.onCreateOptionsMenu(menu);
  
  
  }
       @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
          if (id == R.id.menuSettings) {
               return true;
          }
          return super.onOptionsItemSelected(item);
      }  
  }
  </code></pre>
  
  <p>And here is my first class that starts my first activity:</p>
  
  <pre><code>package com.example.wfhsregistry;
  
  import java.lang.reflect.Field;
  
  import android.app.ActionBar;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.ViewConfiguration;
  
  public class Main extends MenuActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          ActionBar actionbar = getActionBar();
          setContentView(R.layout.splash);
  
          Thread logotimer = new Thread() {
              public void run() {
                  try {
                      sleep(5000);
                      Intent menuIntent = new Intent(
                              "com.example.wfhsregistry.MENU");
                      startActivity(menuIntent);
  
                  } catch (Exception e) {
                      e.printStackTrace();
                  } finally {
                      finish();
                  }
              }
          };
  
          logotimer.start();
  
      }
  
      public void getOverflowMenu() {
  
          try {
              ViewConfiguration config = ViewConfiguration.get(this);
              Field menuKeyField = ViewConfiguration.class
                      .getDeclaredField("sHasPermanentMenuKey");
              if (menuKeyField != null) {
                  menuKeyField.setAccessible(true);
                  menuKeyField.setBoolean(config, false);
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  </code></pre>