Android - Make whole search bar clickable
Solution 1:
This can be simply done by setting Iconified to false on OnClick of SearchView.
searchBar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
searchBar.setIconified(false);
}
});
Reference: Eric Lui's answer
Hopefully it will help.
UPDATE:
You can also use it directly in your XML
app:iconifiedByDefault="false"
Solution 2:
search_bar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
search_bar.onActionViewExpanded();
}
});