So I\'ve been trying to implement android.support.v7.widget.Toolbar in my Activity and to make it look similar to the previously supported split ActionBar.
The solution proposed by public void setupEvenlyDistributedToolbar(){} by kandroidj works perfectly. However to make the solution a bit more complete you need a custom OnclickListener:
attached is my implementation
private void setupOnClickListener4Toolbar(Toolbar toolbar) {
Menu bottomMenu = toolbar.getMenu();
for (int i = 0; i < bottomMenu.size(); i++) {
bottomMenu.getItem(i).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return onOptionsItemSelected(item);
}
});
}
}