I am new to Android Studio and I don\'t get why my toolbar isn\'t shown as described by https://developer.android.com/training/appbar/setting-up I know there are already som
As mentioned by documentation, first, your Activity
should be extend from AppCompatActivity()
.
Second, in your project styles
, Base.Theme.AppCompat.Light.DarkActionBar
is set which means it does have a DarkActionBar
but you already have a Toolbar
in your layout
. So, simply, change:
Base.Theme.AppCompat.Light.DarkActionBar
to:
Theme.AppCompat.Light.NoActionBar
Then, (in java-kotlin side), setup the Toolbar
:
// Note that the Toolbar defined in the layout has the id "my_toolbar"
setSupportActionBar(findViewById(R.id.my_toolbar))
And give the Toolbar
an id.
Then you should be good to go.