Reputation: 813
In the android default search view, 2 clicks are required to input text for search as the first click is used to expand the editText view and another click is to set focus.
It seems to be q redundant and i want to reduce the process to one click only. Is there any methods to do this?
Upvotes: 0
Views: 358
Reputation: 135
You can change this behavior by calling
setIconifiedByDefault(false)
on your searchView. Setting it to false will show the whole field.
Documentation here.
Upvotes: 1
Reputation: 813
The two clicks happen if we put the searchView inside a ListView as the searchView lost focus after that. I suspect searchView behave a similar property with editText view in listView.
With reference to Edit Text in ListActivity ListView loses focus when keyboard comes up
and add the following codes in searchView xml android:focusable="true" android:focusableInTouchMode="true"
would get back the normal behavior of the searchView. Hope this will be useful to other people in the future.
Upvotes: 0