I have a SearchView
that is being always shown and a TabHost
above as follows:
I'm trying to keep SearchView
focused on certain conditions by doing:
searchView.setIconified(false);
searchView.requestFocusFromTouch();
when I need focus. It seems to work fine.
However, if user switches tabs, refocusing SearchBar
in TabHost.OnTabChangeListener
doesn't seem to work properly - keyboard is still being shown as if SearchView
was still focused, but the cursor on search view is gone and user can't type anything in. Tapping on a search view fixes things but I would like to do the "tap" myself instead of the user.
How do I re-focus search view properly?