I have problem with context menu. I have got:
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenu.ContextMenuInfo menuInfo) {
menu.add(Menu.NONE, COPY, Menu.NONE, "Copy")
.setAlphabeticShortcut('d');
menu.add(Menu.NONE, NOTE, Menu.NONE, "Note")
.setAlphabeticShortcut('n');
menu.add(Menu.NONE, PAGE, Menu.NONE, "Page")
.setAlphabeticShortcut('p');
}
and I want close it when I touch screen outside ContextMenu. Please help me!
I am not sure if there is any direct method to close the
ContextMenuon outside click. But if you want that functionality then you may use aDialoginstead of aContextMenuand then usingdialog.setCanceledOnTouchOutside(true)you can close the dialog on outside click.