Disable context menu Xiaomi MIUI


kristina999

Members
Dec 15, 2021
1
3
Hello! I need to disable the context menu of Xiaomi MIUI, because I made my own context menu. But the following standard solution doesn't work:

edt.setCustomSelectionActionModeCallback(new EmptyActionMode());

class EmptyActionMode implements ActionMode.Callback {
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
menu.clear();
return false;
}
public void onDestroyActionMode(ActionMode mode) { }
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
menu.clear();
return false;
}
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return false;
}
}

How can I remove this context menu?
 

Attachments

  • Screenshot 2021-12-15 at 15.06.06.png
    Screenshot 2021-12-15 at 15.06.06.png
    109.2 KB · Views: 62