Can you help me on how to disable searchview when button is pressed? I\'m trying this code:
searchView.setEnabled(false);
searchView.setFocu
SearchView
isn't the actual EditText
you type into, but rather is a LinearLayout
which holds a bunch of views, including the EditText
.
To get the view you actually want for disabling it:
EditText searchViewEditText = (EditText) searchView.findViewById(R.id.search_src_text);
Note, this only works if you're using support v7 SearchView
, since the particular resource id is internal if you use the framework SearchView
.