title: How to add buttons like refresh and search in ToolBar in Android?
body: <p><img src="https://i.stack.imgur.com/kUzHS.png" alt="enter image description here"></p>
  
  <p>I have made a ToolBar, but when I add menu items in menu.xml it always shows as an overflow.
  How do I add it separately?
  Moreover the Title is shown in the middle (vertically), how do I show it at the top?</p>
  
  <p>menu.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.example.toolbar.MainActivity" &gt;
  
         &lt;item android:id="@+id/action_search"
            android:icon="@drawable/ic_launcher"
            android:title="@string/action_search"
            android:showAsAction="ifRoom"
            android:orderInCategory="1" 
            android:menuCategory="secondary"/&gt;
  
      &lt;item
          android:id="@+id/action_settings"
          android:orderInCategory="100"
          android:title="@string/action_settings"
          app:showAsAction="never"/&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>package com.example.toolbar;
  
  import android.support.v7.app.ActionBarActivity;
  import android.support.v7.widget.Toolbar;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.MenuItem;
  
  
  public class MainActivity extends ActionBarActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
          setSupportActionBar(toolbar);
         // toolbar.setNavigationIcon(R.drawable.back);
          toolbar.setLogo(R.drawable.ic_launcher);
          //toolbar.setTitle("Title");
         // toolbar.setSubtitle("Subtitle");
  
  
  
  
  
      }
  
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      @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.action_settings) {
              return true;
          }
          return super.onOptionsItemSelected(item);
      }
  }
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
  
      tools:context="com.example.toolbar.MainActivity" &gt;
  
       &lt;android.support.v7.widget.Toolbar
           xmlns:app="http://schemas.android.com/apk/res-auto"
           android:id="@+id/my_awesome_toolbar"
           android:layout_width="fill_parent"
           android:layout_height="128dp"
           android:layout_alignParentLeft="true"
           android:layout_alignParentTop="true"
           android:background="?attr/colorPrimary"
           android:minHeight="?attr/actionBarSize"
           app:theme="@style/ActionBarThemeOverlay"&gt;
       &lt;/android.support.v7.widget.Toolbar&gt;
  
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>