I have a menu_search in actionbar like this:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/search"
android:title="@string/searchable"
android:icon="@mipmap/ic_search"
android:showAsAction="collapseActionView|ifRoom"
android:actionViewClass="android.widget.SearchView"
android:imeOptions="actionDone"
android:inputType="text"
/>
</menu>
and onCreateOptionsMenu
in activity:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.search_menu, menu);
MenuItem item = menu.findItem(R.id.search);
SearchView searchView = (SearchView)item.getActionView();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(final String newText) {
if (TextUtils.isEmpty(newText)) {
listSongs.clearTextFilter();
} else {
Custom ca = (Custom) listSongs.getAdapter();
ca.getFilter().filter(newText);
}
return true;
}
});
return super.onCreateOptionsMenu(menu);
}
I'm very interested why text doesn't appear in search menu in actionbar while typing? But it is shown in grey popup above the keyboard. What could be the reason of such behaviour? I read something about grey popup in this post, but the difference is: it has text shown in searchview. I haven't found any official documentation that describe this grey popup. Appreciate any advice or link.