title: OnActionExpandListener in menuitem not working. How to fix it?
body: <p>I am developing an Android application which works from API Level 14.</p>
  
  <p>I have an item in my menu file</p>
  
  <pre><code>  &lt;item
          android:id="@+id/menu_search"
          android:actionViewClass="android.widget.SearchView"
          android:icon="@drawable/ic_action_action_search"
          android:orderInCategory="3"
           android:showAsAction="always"/&gt;
  </code></pre>
  
  <p>I want to know the expansion  and collapse of this search view,i  tried this code but it is not working</p>
  
  <pre><code>    @Override
          public boolean onCreateOptionsMenu(Menu menu) {
              // Inflate the menu; this adds items to the action bar if it is present.
              getMenuInflater().inflate(R.menu.activity_search, menu);
              MenuItem mSearchItem = menu.findItem(R.id.menu_search);
  
              mSearchItem.setOnActionExpandListener( new OnActionExpandListener() {
  
                  @Override
                  public boolean onMenuItemActionExpand(MenuItem item) {
                      // TODO Auto-generated method stub
                      Toast.makeText(MainActivity.this, "onMenuItemActionExpand", 1)
                       .show();
                      return true;
                  }
  
                  @Override
                  public boolean onMenuItemActionCollapse(MenuItem item) {
                      // TODO Auto-generated method stub
                      Toast.makeText(MainActivity.this, "onMenuItemActionExpand", 1)
                       .show();
                      return true;
  
                  }
              });
      }
  
  }
  </code></pre>
  
  <p>Why am i not getting the Toasts?</p>
  
  <p>I also tried code form <a href="http://developer.android.com/guide/topics/ui/actionbar.html#ActionViewCollapsing">Handling collapsible action views</a>, it is also not working! Why these things are not working? </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I can get it work using</p>
  
  <pre><code>mSearchView.addOnLayoutChangeListener(new OnLayoutChangeListener() {
  
              @Override
              public void onLayoutChange(View v, int left, int top, int right,
                      int bottom, int oldLeft, int oldTop, int oldRight,
                      int oldBottom) {
  
                  SearchView searchView = (SearchView) v;
                  if (searchView.isIconified()) {
                         }
                         else{
                          }
             }
     });
  </code></pre>
  
  <p>But it is very slow! </p>