This question is a follow up to Show android SearchView EditText by default. My SearchView used to work fine until I added android:iconifiedByDefault="false"
to the layout. Now, when I click on the icon or type in the search field, no search takes place. Does anyone know how to fix this problem? here is my SearchView as it exists now.
<SearchView
android:id="@+id/search"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:queryHint="@string/search_hint"
android:iconifiedByDefault="false"
android:textSize="16sp" />
I already tried the following:
mSearch.setOnSearchClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
getActivity().onSearchRequested();
//other stuff happen here
}
});