I have a searchView which looks like this:
private void setupSearchView() {
mSearchView = (SearchView) getActivity().findViewById(
R.id.search_vi
I managed to do this in the following way:
Setup the search view on click listener
mSearchView.setOnClickListener(this);
Catch the onClick event:
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.searchView:
mSearchView.onActionViewExpanded();
break;
}
}
In this way the keyboard and search are activated if you click antwhere on the search bar.