title: Hide menu items when ActionLayout is opened
body: <p>I am using ActionBarSherlock:</p>
  
  <p>There are 3 menu items, of which only 1 has an ActionLayout.</p>
  
  <p><strong>default_menu.xml</strong></p>
  
  <p>
  </p>
  
  <pre><code>&lt;item
      android:id="@+id/searchIcon"
      android:icon="@drawable/search_icon"
      android:actionLayout="@layout/search_icon_actionview"
      android:showAsAction="always|collapseActionView"
      android:title="Search"/&gt;
  &lt;item
      android:id="@+id/newIcon"
      android:icon="@drawable/new_icon"
      android:orderInCategory="0"
      android:showAsAction="ifRoom|collapseActionView"
      android:title="New"/&gt;
  &lt;item
      android:id="@+id/notificationIcon"
      android:icon="@drawable/notification_icon"
      android:orderInCategory="0"
      android:showAsAction="ifRoom|collapseActionView"
      android:title="Notifications"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>if i am using the above code. Only 1st 2 icons are visible. And if i make 2nd and 3rd as <strong>Always</strong> they remain even when the <strong>actionLayout</strong> is opened when clicked on <strong>Search</strong>.</p>
  
  <p>I want to show all the 3 Menu Items initially and when search_icon is clicked hide every Item.</p>
  
  <p>I also have a doubt about my implementation, whether i am doing i the right way.</p>
  
  <p><strong>In the Activity's(which has a viewPager) first Fragment:</strong></p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()) {
  
      case R.id.searchIcon:
  
      mEtSearchbar.clearFocus();
      (new Handler()).postDelayed(new Runnable() {
         public void run() {
             mEtSearchbar.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, 0, 0, 0));
             mEtSearchbar.dispatchTouchEvent(MotionEvent.obtain(SystemClock.uptimeMillis(), SystemClock.uptimeMillis(), MotionEvent.ACTION_UP , 0, 0, 0));
         }
      }, 100);
  
          return true;
      case R.id.newIcon:
  
          return true;
      case R.id.notificationIcon:
  
          return true;
      default:
          return super.onOptionsItemSelected(item);
      }
  }
  
  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      // TODO Auto-generated method stub
      inflater.inflate(R.menu.default_menu, menu);
  
      mSearchbar = (MenuItem) menu.findItem(R.id.searchIcon);
      View actionview = mSearchbar.getActionView();
      mEtSearchbar = ((EditText) actionview.findViewById(R.id.search_editText));
      ImageView searchImage = ((ImageView) actionview.findViewById(R.id.search_image));
      searchImage.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
  
              String s = mEtSearchbar.getText().toString();
              Toast.makeText(getSherlockActivity(), "Searching for: " + s, Toast.LENGTH_SHORT)
                      .show();
          }
      });
      super.onCreateOptionsMenu(menu, inflater);
  }
  </code></pre>