My Toolbar and EditText look like this:

I tried
Add the EditText to the Toolbar xml.
Add the Toolbar to your Activity's xml layout, at the top.
Set the toolbar as ActionBar:
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
This will make the toolbar "become" the ActionBar with EditText inside.