I am trying to add a custom view to the new toolbar (Lollipop) . But somehow the view gets added below the toolbar. It was working fine when I used actionBar.setCustom
actionBar.setCustom
Works great for me.
LayoutInflater mInflater=LayoutInflater.from(context); View mCustomView = mInflater.inflate(R.layout.toolbar_custom_view, null); toolbar.addView(mCustomView);