java - Android: Option Menu stays empty white -


i tried add option menu app, it's not showing content.

here's xml:

<menu xmlns:android="https://schemas.android.com/apk/res/android">      <item android:id="@+id/item1"          android:title="test1"/>      <item android:id="@+id/item2"          android:title="test2"/>      <item android:id="@+id/item3"          android:title="test3"          android:icon="@drawable/icon"/>  </menu> 

path res/menu/menu.xml

that's code in main activity:

public boolean oncreateoptionsmenu(menu menu){      menuinflater inflater = getmenuinflater();      inflater.inflate(r.menu.menu, menu);      return true;  } 

i can open menu , shows 3 white squares. can click on them , menu closes.

i tried changing text color via android:textcolor , background color via android:color, didn't work either. :(

edit: it's working if use menu.add(...), prefer using xml resource...

kind regards, jellyfish

you should change <menu xmlns:android="https://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">


Comments