1

I have recently come across a problem that the context menu items are not showing up for example: http://i.imgur.com/O1EsY1B.png

Current code (Activity)

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)
{
    super.onCreateContextMenu(menu, v, menuInfo);
    if (v.getId() == R.id.txtTotalOwe)
    {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu_edit_contact, menu);
    }
}

And here is the R.menu.menu_edit_contact

<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">

<item android:id="@+id/edit_contact"
      android:title="Edit Contact"
      android:showAsAction="never"
      android:icon="@null"/>

<item android:id="@+id/edit_delete"
      android:title="Delete Contact"
      android:showAsAction="never"
      android:icon="@null"/>

Basically the 2 context menues are displaying, the only problem is the text isn't displaying as it's suppose to.

Zak
  • 21
  • 4
  • override this method...@Override public boolean onCreateOptionsMenu(Menu menu) { new MenuInflater(this).inflate(R.menu.menu_edit_contact, menu); super.onCreateOptionsMenu(menu, inflater); } – Muhammad Waleed May 22 '16 at 14:22
  • @ExceptionLover I've already tried that method, nothing seemed to work. – Zak May 22 '16 at 14:25
  • What theme are you using? Check / post your styles.xml – jaibatrik May 22 '16 at 15:33
  • @jaibatrik https://github.com/wolfbytestudio/Tappers/blob/master/Tappers/app/src/main/res/values-v21/styles.xml – Zak May 22 '16 at 16:48
  • See if this helps - http://stackoverflow.com/questions/24652964/android-popup-menu-text-color-appcompat – jaibatrik May 22 '16 at 16:53
  • @jaibatrik still nothing works, tried more theme changes also – Zak May 22 '16 at 17:14

1 Answers1

0
   super.onCreateContextMenu(menu, v, menuInfo);

        menu.add(0, 0, 0, "Share");
        menu.add(0, 1, 1, "View");
        menu.add(0, 2, 2, "Update");
        menu.add(0, 3, 3, "Delete");
        menu.add(0, 3, 3, "Delete All");

    }

for detailed information visit this site

http://androidcoding.in/2016/03/06/android-tutorial-on-context-menu/

Abhishek
  • 51
  • 2