onCreateOptionsMenu not getting called, i have no clue whats going on
Here is my activity
class BasicLayoutActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_basic_layout)
setSupportActionBar(toolbar)
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
super.onCreateOptionsMenu(menu)
menuInflater.inflate(R.menu.menu_basic_layout,menu)
return true
}
}
menu xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".BasicLayoutActivity">
<item android:id="@+id/like" android:title="like" app:showAsAction="always"
android:icon="@drawable/ic_insert_emoticon_black_24dp"/>
</menu>
theme applied
<style name="BaseTheme" parent="Theme.MaterialComponents.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
And stackoverflow is showing me error that 'It looks like your post is mostly code, please add some more details :P'