MenuItemCompat.setOnActionExpandListener deprecated : <p>I have some code that sets a boolean if the search view is open or not.  </p>

<pre><code>MenuItemCompat.setOnActionExpandListener(action_search, new MenuItemCompat.OnActionExpandListener() {
            @Override
            public boolean onMenuItemActionExpand(MenuItem item){
                isSearch = true;
                return true;
            }
            @Override
            public boolean onMenuItemActionCollapse(MenuItem item){
                isSearch = false;
                return true;
            }
        });
</code></pre>

<p>It works.  I'm happy with the way it responds.  However, it it shows as deprecated, the setOnActionExpandListener is crossed out with the warning</p>

<blockquote>
  <p>android.support.v4.view.MenuItemCompat.setOnActionExpandListener is deprecated</p>
</blockquote>

<p>Suggestions?</p>
