https://kotlinlang.org logo
#android
Title
# android
m

mending3

11/16/2019, 3:01 PM
why is action my action bar showing the title as fragment name? for example if I'm in HomeFragment, the action bar title is HomeFragment etc
a

Anastasia Finogenova

11/16/2019, 3:10 PM
If you are using navigation component that is the default behavior. The title in the graph is your toolbar title
m

mending3

11/16/2019, 3:17 PM
so what's the workaround to get myself out on this?
a

Anastasia Finogenova

11/16/2019, 3:17 PM
Either set to empty string if you don't want any title or change to whatever you want including a variable value
m

mending3

11/16/2019, 3:20 PM
Thank you. changed the fragment's label on
navigation.xml
solves this
note: the action bar's title follows the application name after removing the fragment's label
thank you once again @Anastasia Finogenova
a

Anastasia Finogenova

11/16/2019, 3:24 PM
No problem 😊
a

Aslam Hossin

11/16/2019, 4:20 PM
Change title (Add label in your
fragment
) form
Navigation
graph .
8 Views