title: ActionBar icons won't show up for FragmentActivity despite setHasOptionsMenu(true)
body: <p>In my android app, I am trying to add icons to the ActionBar in my FragmentActivity; however, it remains blank. Essentially I have a FragmentActivity with separate Fragments which are scrollable tabs like this: </p>
  
  <p><img src="https://i.stack.imgur.com/Vx3e0.png" alt="enter image description here"></p>
  
  <p>I want to actionbar to have two icons from block.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=".SetupActivity" &gt;
  
  
  
      &lt;item android:id="@+id/action_overflow"
            android:title="@string/action_settings"
            android:orderInCategory="100"
            android:icon="@drawable/ic_action_overflow"
            app:showAsAction="always" /&gt;
  
      &lt;item android:id="@+id/action_search"
            android:title="@string/search"
            android:orderInCategory="200"
            android:icon="@drawable/ic_action_search"
            app:showAsAction="always" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>I want it to look something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/d213H.jpg" alt="enter image description here"></p>
  
  <p>I am trying to follow this: <a href="https://stackoverflow.com/questions/6936842/oncreateoptionsmenu-not-being-called-on-fragmentactivity-when-run-on-phone-versi">onCreateOptionsMenu not being called on FragmentActivity when run on phone version</a></p>
  
  <p>and this  <a href="https://github.com/thecodepath/android_guides/wiki/ActionBar-Tabs-with-Fragments" rel="nofollow noreferrer">https://github.com/thecodepath/android_guides/wiki/ActionBar-Tabs-with-Fragments</a></p>
  
  <p>Here is my BlockActivity class which extends FragmentActivity. I am unsure why the ActionBar is unable to be edited in spite of having the onCreateOptionsMenu method.</p>
  
  <pre><code>package com.spicycurryman.getdisciplined10.app;
  
  import android.annotation.TargetApi;
  import android.app.ActionBar;
  import android.app.FragmentTransaction;
  import android.os.Build;
  import android.os.Bundle;
  import android.support.v4.app.FragmentActivity;
  import android.support.v4.view.ViewPager;
  import android.view.Menu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  
  import info.androidhive.tabsswipe.adapter.TabsPagerAdapter;
  
  
  // Find out about the default file template warning
  
  
  
  /**
   * Created by Spicycurryman on 6/17/14.
   */
  public  class BlockActivity extends FragmentActivity implements
          ActionBar.TabListener {
  
  
  
      private ViewPager viewPager;
      private TabsPagerAdapter mAdapter;
      private ActionBar actionBar;
      // Tab titles
      private String[] tabs = {"Installed", "System", "Custom"};
  
      @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.block_apps);
  
  
          // Initilization
          viewPager = (ViewPager) findViewById(R.id.pager);
          actionBar = getActionBar();
          mAdapter = new TabsPagerAdapter(getSupportFragmentManager());
  
          viewPager.setAdapter(mAdapter);
          actionBar.setHomeButtonEnabled(false);
          actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  
          // Adding Tabs
          for (String tab_name : tabs) {
              actionBar.addTab(actionBar.newTab().setText(tab_name)
                      .setTabListener(this));
          }
  
          /**
           * on swiping the viewpager make respective tab selected
           * */
          viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
  
              @Override
              public void onPageSelected(int position) {
                  // on changing the page
                  // make respected tab selected
                  actionBar.setSelectedNavigationItem(position);
              }
  
              @Override
              public void onPageScrolled(int arg0, float arg1, int arg2) {
              }
  
              @Override
              public void onPageScrollStateChanged(int arg0) {
              }
          });
  
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu){
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.block, menu);
  
          return super.onCreateOptionsMenu(menu);
      }
  
      @Override
      public boolean onPrepareOptionsMenu(Menu menu) {
          return super.onPrepareOptionsMenu(menu);
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          int id = item.getItemId();
          if (id == R.id.action_overflow) {
              return true;
          } else if(id == R.id.action_search) {
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
  
  
  
  
      @Override
      public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
          viewPager.setCurrentItem(tab.getPosition());
  
      }
  
      @Override
      public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
  
      }
  
      @Override
      public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {
  
      }
  
  
  
  
  
      }
  </code></pre>
  
  <p>I have tried everything from inflating from the Fragments to doing it from the FragmentActivity and everything in between not sure what to do now...</p>