diff options
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/AbstractSearchableListItemActivity.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/AbstractSearchableListItemActivity.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/AbstractSearchableListItemActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/AbstractSearchableListItemActivity.java index b8e57f47..df33e665 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/AbstractSearchableListItemActivity.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/AbstractSearchableListItemActivity.java @@ -2,6 +2,7 @@ package de.thedevstack.conversationsplus.ui; import android.content.Context; import android.os.Bundle; +import android.support.v4.view.MenuItemCompat; import android.text.Editable; import android.text.TextWatcher; import android.view.Menu; @@ -26,7 +27,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity { private EditText mSearchEditText; - private final MenuItem.OnActionExpandListener mOnActionExpandListener = new MenuItem.OnActionExpandListener() { + private final MenuItemCompat.OnActionExpandListener mOnActionExpandListener = new MenuItemCompat.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(final MenuItem item) { @@ -103,11 +104,11 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity { public boolean onCreateOptionsMenu(final Menu menu) { getMenuInflater().inflate(R.menu.choose_contact, menu); final MenuItem menuSearchView = menu.findItem(R.id.action_search); - final View mSearchView = menuSearchView.getActionView(); + final View mSearchView = MenuItemCompat.getActionView(menuSearchView); mSearchEditText = (EditText) mSearchView .findViewById(R.id.search_field); mSearchEditText.addTextChangedListener(mSearchTextWatcher); - menuSearchView.setOnActionExpandListener(mOnActionExpandListener); + MenuItemCompat.setOnActionExpandListener(menuSearchView, mOnActionExpandListener); return true; } |