I was trying to show option menu in activity_main.xml App bar so I go in value folder and then create a menu and write this code in MainActivity.kt
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main_menu, menu)
return true
If I run this application on device screen 5.0 then 3 dots show in Appbar and works fine but if I run this application on smaller screen like 4.0 inch or smaller then 5.0 so 3 dots menu not shows in Appbar but still working if I press menu button in softkeys. Why this menu goes out of screen on smaller screen. I think I am forgetting something to write or create.