title: Add button in android action bar
body: <p>I trying to add a button beside HealthyApp, but no luck .</p>
  
  <p>This is my initial code and image</p>
  
  <pre><code>  final ActionBar actionBar = getSupportActionBar();
      actionBar.setDisplayHomeAsUpEnabled(true);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mMcgL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mMcgL.png" alt="enter image description here"></a></p>
  
  <p>I want to add a delete button beside HealthyApp but the HealthyApp title gone. </p>
  
  <pre><code> final ActionBar actionBar = getSupportActionBar();
          actionBar.setDisplayHomeAsUpEnabled(true);
          actionBar.setDisplayShowHomeEnabled(false);
          actionBar.setDisplayShowTitleEnabled(false);
          LayoutInflater mInflater = LayoutInflater.from(this);
          View mCustomView = mInflater.inflate(R.layout.header_button, null);
          Button mTitleTextView = (Button) mCustomView.findViewById(R.id.title_text);
          mTitleTextView.setText("Delete");
          actionBar.setCustomView(mCustomView);
          actionBar.setDisplayShowCustomEnabled(true);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/FDFYl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FDFYl.png" alt="enter image description here"></a></p>
  
  <p><strong>delete_task</strong></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"
      android:paddingBottom="@dimen/activity_vertical_margin"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:background="#d9d9d9"
          android:minHeight="?attr/actionBarSize"&gt;
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:gravity="right"
              android:layout_height="wrap_content"&gt;
  
              &lt;Button
                  android:text="Delete"
                  android:layout_width="wrap_content"
                  android:background="#000"
                  android:textColor="#fff"
                  android:layout_height="wrap_content"
                  android:textSize="16dp" /&gt;
          &lt;/LinearLayout&gt;
  
      &lt;/android.support.v7.widget.Toolbar&gt;
  
      &lt;ImageView
          android:src="@mipmap/to_do"
          android:layout_marginTop="50dp"
          android:layout_width="130dp"
          android:layout_height="210dp"
          android:id="@+id/imageView"
          android:gravity="center"
          android:layout_centerHorizontal="true"/&gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginBottom="20dp"
          android:text="No List Found"
          android:textSize="15dp"
          android:textColor="@color/btn_login"
          android:gravity="center"
          android:id="@+id/NoData"
          android:layout_centerHorizontal="true"
          android:layout_below="@+id/imageView"/&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;ListView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/list_todo"
              android:layout_weight="1"
              android:layout_alignParentLeft="true" /&gt;
  
      &lt;/RelativeLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mdcUq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mdcUq.png" alt="enter image description here"></a></p>