title: Custom Action View can't be clicked
body: <p>I am trying to add a custom <code>ActionView</code> to my <code>ActionBar</code>.</p>
  
  <p>I am trying to add the common refresh button. (<code>ImageButton</code>, <code>ProgressBar</code> inside a <code>FrameLayout</code>) but if I use an <code>ActionView</code> <code>onOptionsItemSelected()</code> is never called.</p>
  
  <p>Here's the code:</p>
  
  <p>In my <code>Activity</code>:</p>
  
  <pre><code>@Override
  public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
  inflater.inflate(R.menu.messages_actionbar, menu);
  mRefreshView = (RefreshView) menu.findItem(R.id.messages_refresh).getActionView();
  
  return super.onCreateOptionsMenu(menu);
  }
  </code></pre>
  
  <p><code>messages_actionbar</code>'s src:</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/messages_refresh"
          android:title="title"
          android:icon="@drawable/icon"
          android:showAsAction="always"
          android:actionViewClass="com.blabla.RefreshView"/&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p><code>RefreshView</code>'s code:</p>
  
  <pre><code>public class RefreshView extends FrameLayout {
  
      private ImageView mButton;
      private ProgressBar mProgressBar;
      private boolean mLoading;
  
      public RefreshView(Context context) {
          super(context, null);
          initView(context);
      }
  
      public RefreshView(Context context, AttributeSet attrs) {
          super(context, attrs, 0);
          initView(context);
      }
  
      public RefreshView(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
          initView(context);
      }
  
      private void initView(Context context) {
          LayoutInflater inflator = LayoutInflater.from(context);
          View v = inflator.inflate(R.layout.actionbar_refresh, this);
          mProgressBar = (ProgressBar) v.findViewById(R.id.action_refresh_progress);
          mButton = (ImageView) v.findViewById(R.id.action_refresh_button);
      }
  
      public void setLoading(boolean loading) {
          if (loading != mLoading) {
              mProgressBar.setVisibility(loading ? View.VISIBLE : View.GONE);
              mButton.setVisibility(loading ? View.GONE : View.VISIBLE);
              mLoading = loading;
          }
      }
  }
  </code></pre>
  
  <p><code>actionbar_refresh</code>'s src code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;FrameLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"&gt;
  
      &lt;ImageView
          android:id="@+id/action_refresh_button"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:scaleType="center"
          android:background="@drawable/icon" /&gt;
  
      &lt;ProgressBar
          android:id="@+id/action_refresh_progress"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center"
          android:visibility="gone"
          android:indeterminate="true" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>On the other hand, if I set a <code>clickListener</code> to the <code>ImageView</code> inside the <code>RefreshView</code> class it gets called.</p>
  
  <p>Anyone did this already?</p>