0

so, the overflow menu appears in the application, but the title the string is not shown in the menu items. I have tried many things but I couldn't figure out a way to make it appear.

for example I tried overriding onPrepareOptionsMenu function. It doesn't work.

please help me out guys

this is my options_menu.xml file


    <?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">
    
        <item
            android:id="@+id/aboutFragment"
            android:title="About"
            android:menuCategory="secondary"
            app:showAsAction="never"/>    
       </menu>

and here is how I am inflating it my MainActivity.kt file

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
    menuInflater.inflate(R.menu.options_menu, menu)
    return true
}
4
  • Please try to do proper R&D before asking question. It seems that you didn't do proper research for the answer of your question. I have given answer from an existing question. Please check. Commented Jun 10, 2021 at 8:57
  • 1
    The problems is not with the schema address. It is similar with the one you suggested.
    – Amanuel
    Commented Jun 10, 2021 at 10:23
  • Sorry from my side as I did mistake in understanding. Commented Jun 10, 2021 at 10:25
  • Can you please check this link. It might help. Commented Jun 10, 2021 at 10:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.