Search code examples
androidandroid-actionbarcompatibility

Substitute to MenuCompat.setShowAsAction() on Android


While searching for a way to show an option in the ActionBar and still be compatible with Honey I came across the MenuCompat.setShowAsAction() method from the compatibility library (http://developer.android.com/reference/android/support/v4/view/MenuCompat.html), but it is deprecated and I can't find a substitute in the library to do the same thing. Any Ideas?

Thanks In Advance


Solution

  • If you read the JavaDocs for setShowAsAction() on MenuCompat at the page you linked to above, you will find your answer:

    Use MenuItemCompat.setShowAsAction(MenuItem, int)