I want to use one toolbar across the Application. But don't want to include it in a layout. Because I have a different hierarchy of fragment and activity. I wish to do an operation of setting of the action bar in base activity only. I tried it with inflating toolbar view and then setting it to action bar. I can see it in view hierarchy, but it is not actually showing on the screen, also not giving any error.
mCustomActionBarView = (Toolbar) getLayoutInflater().inflate(R.layout.application_action_bar, null, true);
mCustomActionBarView.setLayoutParams(new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT, (int) getResources().getDimension(R.dimen.width_action_bar)));
setSupportActionBar(mCustomActionBarView);
BaseActivity
is extending AppCompatActivity
.