title: Adding Button and handler to ActionBar in Android
body: <p>This app tracks my workout routine and I wanted to share it with a few friends, so I need to make a button to add additional exercises. Currently I have an actionbar with the + button as per below, that expands to an editText field when pressed.</p>
  
  <p><img src="https://i.imgur.com/hj6TL.png" alt="Image that I&#39;m not allowed to post due to low rep..."></p>
  
  <p><strong>Problem #1:</strong> The editText field seems to be set to wrap_Content, I would rather it fill remaining space but I have no idea how. It's been implemented like this;</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:id="@+id/menu_create"
          android:title="@string/menu_create"
          android:showAsAction="ifRoom|collapseActionView"
          android:actionViewClass="android.widget.EditText" /&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p><strong>Problem #2:</strong> I need a button to appear as well that can be pressed once the name of the exercise has been typed in. So far I've had no luck figuring out how to do this. I'm just using the <a href="http://developer.android.com/guide/topics/ui/actionbar.html" rel="nofollow noreferrer">Android Dev Guide</a>, I haven't been able to google anything that comes close to what I'm after...</p>
  
  <p>Am I on the right track? If so, any tips/hints on how to add the button and fix up the editText field? If not, any suggestions for other ways to implement? (obviously a whole new activity is a bit of overkill...)</p>