I have a Toolbar
which has a custom TextView
inside:
You are overriding the id of toolbar in the include tag. So the R.id.toolbar
is no longer id of your included toolbar for your activity but now it is R.id.app_bar
instead.
If you keep the id in include tag then use following code to access your toolbar:
Toolbar toolbar = (Toolbar) activity.findViewById(R.id.app_bar);