- 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:
How can I remove this context menu?
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?