Does anybody knows how to set android search dialog hint dynamically? T have try to do something like:
I managed to do this with ABS using the OnActionExpandListener and a custom actionView, e.g.:
menu.add("Search")
.setActionView(R.layout.collapsible_edittext)
.setOnActionExpandListener(new MenuItem.OnActionExpandListener()
{
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
((EditText) item.getActionView()).setHint("Your custom text here");
return true;
}
@Override
public boolean onMenuItemActionCollapse(MenuItem item) {
return true;
}
});
with collapsible_edittext.xml: