ActionBar SearchView not fully expanding in landscape mode
Did you try something like that?
editView.setOnKeyListener(new OnKeyListener() {
private boolean extended = false;
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (!extended && event.getAction() == KeyEvent.ACTION_DOWN) {
extended = true;
LayoutParams lp = v.getLayoutParams();
lp.width = LayoutParams.MATCH_PARENT;
}
return false;
}
});
MenuItemCompat's SearchView has a property named maxWidth.
final MenuItem searchItem = menu.findItem(R.id.action_search);
final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
searchView.setMaxWidth(xxx);
use screen width instead of xxx offcourse