I have been using the latest Toolbar from AppCompatv7 lib.I have placed a textview in the ToolBar ViewGroup And I want to set a title into this Textview from the fragment in my
This has worked for me, in Kotlin. Put this in your fragment class:
if (activity != null) { (activity as MainActivity).supportActionBar?.title = getString(R.string.action_history) }