title: Android Actionbar shows no items
body: <p>I'm new to android and have this problem for while: No item appear on action bar, as you can see in the image below:</p>
  
  <p><a href="https://i.stack.imgur.com/0m5h3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0m5h3.png" alt="enter image description here"></a></p>
  
  <p>Here is my 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="com.myappshop.myapp.MainActivity"&gt;
  
      &lt;item
          android:id="@+id/action_favorite"
          android:icon="@drawable/share_icon"
          android:title="@string/share"
          app:showAsAction="always"/&gt;
  
  
      &lt;item
          android:id="@+id/action_settings"
          android:orderInCategory="100"
          android:title="@string/action_settings"
          app:showAsAction="ifRoom" /&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>And the MainActivity.java:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
      private static final String TAG = MainActivity.class.getSimpleName();
  
      EditText mEditTextWord;
      EditText mEditTextDefinition;
      DictionaryDatabase mDB;
      ListView mListView;
  
        @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          mDB = new DictionaryDatabase(this);
          mEditTextWord = (EditText)findViewById(R.id.editTextWord);
          mEditTextDefinition = (EditText)findViewById(R.id.editTextDefinition);
          Button buttonAddUpdate = (Button)findViewById(R.id.buttonAddUpdate);
  
          buttonAddUpdate.setOnClickListener(
                  new  View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          saveRecord();
                      }
                  });
  
  
  
          mListView = (ListView)findViewById(R.id.listView);
          mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View
                      view, int position, long id) {
                  Log.d(TAG, "the id is logged " + Long.toString(id));
  
                  String nextId = String.valueOf(id+1);
                  Intent intent = new Intent(view.getContext(),DetailActivity.class);
                  intent.putExtra("key" ,mDB.getWord(id)+"");
                  intent.putExtra("value",mDB.getDefinition(id)+"");
                  intent.putExtra("nextId",nextId+"");
                  startActivity(intent);
              }
          });
  
          mListView.setOnItemLongClickListener(new  AdapterView.OnItemLongClickListener() {
              @Override
              public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  Toast.makeText(MainActivity.this,
                          "Records deleted = " + mDB.deleteRecord(id),
                          Toast.LENGTH_SHORT).show();
                  updateWordList();
                  return true;
              }
          });
          updateWordList();
  
      }
  
  
      private void saveRecord() {
          mDB.saveRecord(mEditTextWord.getText().toString(),
                  mEditTextDefinition.getText().toString());
          mEditTextWord.setText("");
          mEditTextDefinition.setText("");
          updateWordList();
      }
  
      private void updateWordList() {
          SimpleCursorAdapter simpleCursorAdapter = new
                  SimpleCursorAdapter( this,
                  android.R.layout.simple_list_item_1,
                  mDB.getWordList(),
                  new String[]{"word"},
                  new int[]{android.R.id.text1},
                  0);
          mListView.setAdapter(simpleCursorAdapter);
      }
  
  
      @Override  //added following https://stackoverflow.com/a/27192897/5774375 
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              // Respond to the action bar's Up/Home button
              case android.R.id.home:
                  NavUtils.navigateUpFromSameTask(this);
                  return true;
          }
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout 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"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context="com.myappshop.myapp.MainActivity"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
          &lt;android.support.v7.widget.Toolbar
              android:id="@+id/toolbar"
              android:layout_width="match_parent"
              android:layout_height="?attr/actionBarSize"
              android:background="?attr/colorPrimary"
              app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;include layout="@layout/content_main" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>The minimum API that I'v set is 15.
  I've looked at similar answers on SO, like <a href="https://stackoverflow.com/questions/27192848/actionbar-up-navigation-not-working-on-api-15">this</a> but none resolve my probelm. So appreciate your help. </p>
  
  <p>UPDATE: DetailActivity.java added:</p>
  
  <pre><code>public class DetailActivity extends AppCompatActivity {
      private static final String TAG = DetailActivity.class.getSimpleName();
  
      Button shareBtn, nextBtn, prevBtn, indexBtn ;
      DictionaryDatabase mDB;
      TextView title, body; //Globally Declaration
      String nextId;
      int id;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_detail);
  
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
  
  
          try{
              String key = getIntent().getStringExtra("key");
              String value = getIntent().getStringExtra("value");
              String idString = getIntent().getStringExtra("nextId");
              id = Integer.parseInt(idString) + 1;  //to be used to rener the next item
  
  
              title = (TextView) findViewById(R.id.title);
              title.setText(key);
  
              body = (TextView) findViewById(R.id.body);
              body.setText(value);
          }
          catch(Exception e){
              e.printStackTrace();
          }
  
          final Button button = (Button) findViewById(R.id.shareBtn);
  
  
          button.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  // Perform action on click
                  Intent sendIntent = new Intent();
                  sendIntent.setAction(Intent.ACTION_SEND);
                  sendIntent.putExtra(Intent.EXTRA_TEXT, body.getText().toString());
                  sendIntent.setType("text/plain");
                  startActivity(sendIntent);
              }
          });
          shareBtn = (Button) findViewById(R.id.shareBtn);
  
  
          //render the next word
          mDB = new DictionaryDatabase(this);
          nextBtn = (Button) findViewById(R.id.nextBtn);
          prevBtn = (Button) findViewById(R.id.prevBtn);
          indexBtn = (Button) findViewById(R.id.indexBtn);
  
          nextBtn.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  id+=1;
                  Log.d(TAG, "the next item to be fetched has id: " + Long.toString(id));
  
                  Log.d(TAG, "return value is: " + mDB.getWord(id));
                  if (mDB.getWord(id) != "") {
                      String key = mDB.getWord(id);
                      String value = mDB.getDefinition(id);
  
                      title = (TextView) findViewById(R.id.title);
                      title.setText(key);
  
                      body = (TextView) findViewById(R.id.body);
                      body.setText(value);
                      prevBtn.setVisibility(View.VISIBLE);
  
                  } else {
                          finish();
                  }
              }
          });
  
          prevBtn.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  id-=1;
                  if (mDB.getWord(id) != "") {
                      String key = mDB.getWord(id);
                      String value = mDB.getDefinition(id);
  
                      title = (TextView) findViewById(R.id.title);
                      title.setText(key);
  
                      body = (TextView) findViewById(R.id.body);
                      body.setText(value);
                      nextBtn.setVisibility(View.VISIBLE);
  
                  } else {
                      finish();
                  }
  
              }
          });
  
          indexBtn.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  finish();
  
              }
          });
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
              // Respond to the action bar's Up/Home button
              case android.R.id.home:
                  NavUtils.navigateUpFromSameTask(this);
                  return true;
          }
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>