views:

64

answers:

0

Hi

I'm trying to add some custom menu items to some EditText-instances. They appear on in the menu, but when I click the buttons the onTextContentMenuItem-method is not called. The EditText-instances are in a ListView if that matters.

Any advice on the matter?

Relevant code:

class DocumentFragment extends EditText {

  public DocumentFragment(Context context) {
   super(context);
  }

  @Override
  public void onCreateContextMenu(ContextMenu menu) {
   menu.add(Menu.CATEGORY_ALTERNATIVE, CONVERT_TO_H1, Menu.NONE, "Convert to H1");
      menu.add(Menu.CATEGORY_ALTERNATIVE, CONVERT_TO_P, Menu.NONE,  "Convert to P");
      super.onCreateContextMenu(menu);
  }

  @Override
  public boolean onTextContextMenuItem(int id) {
   Log.i("ID", String.valueOf(id)); // The id of CONVERT_TO_{H1,P} never appears.
   return super.onTextContextMenuItem(id);
  }
 }