fixed search in abstractsearchablelistitem

This commit is contained in:
Daniel Gultsch 2018-02-16 14:57:49 +01:00
parent bf85d30421
commit bd90f2140d
3 changed files with 3 additions and 4 deletions

View file

@ -104,8 +104,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
getMenuInflater().inflate(R.menu.choose_contact, menu);
final MenuItem menuSearchView = menu.findItem(R.id.action_search);
final View mSearchView = menuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView
.findViewById(R.id.search_field);
mSearchEditText = (EditText) mSearchView.findViewById(R.id.search_field);
mSearchEditText.addTextChangedListener(mSearchTextWatcher);
menuSearchView.setOnActionExpandListener(mOnActionExpandListener);
return true;

View file

@ -596,7 +596,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
menuHideOffline.setChecked(this.mHideOfflineContacts);
mMenuSearchView = menu.findItem(R.id.action_search);
mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener);
View mSearchView = MenuItemCompat.getActionView(mMenuSearchView);
View mSearchView = mMenuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView.findViewById(R.id.search_field);
mSearchEditText.addTextChangedListener(mSearchTextWatcher);
mSearchEditText.setOnEditorActionListener(mSearchDone);

View file

@ -4,7 +4,7 @@
<item
android:id="@+id/action_search"
android:actionLayout="@layout/actionview_search"
app:actionLayout="@layout/actionview_search"
android:icon="?attr/icon_search"
app:showAsAction="collapseActionView|always"
android:title="@string/search"/>