I have an xml that I use with so many activities with fragments file but my problem is that I can\'t display the text I want in the toolbar, I use that xml that way because
Setting,
app:title="@string/my_title"
within the declaration of the the android.support.v7.widget.Toolbar, hard codes the title in the toolbar.
To set the title programatically,
Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
toolbar.setTitle("my title");
setSupportActionBar(toolbar);
in your activity class.