не помогает и все ответы здесь тоже:
https://stackoverflow.com/questions/6275299/how-to-disable-copy-paste-from-to-edittext
кто решал данную проблему?
https://www.tutorialspoint.com/how-to-disable-copy-paste-from-to-edittext-in-android-app-using-kotlin Вот, просто предопределить customSelectionActionModeCallback
там тоже самое(
EditText edit = findViewById(R.id.mainactivityEditText1); if (Build.VERSION.SDK_INT >= 26) { edit.setCustomInsertionActionModeCallback(new ActionMode.Callback2(){ @Override public boolean onCreateActionMode(ActionMode p1, Menu p2) { return false; } @Override public boolean onPrepareActionMode(ActionMode p1, Menu p2) { return false; } @Override public boolean onActionItemClicked(ActionMode p1, MenuItem p2) { return false; } @Override public void onDestroyActionMode(ActionMode p1) { } }); edit.setCustomSelectionActionModeCallback(new ActionMode.Callback2() { @Override public boolean onCreateActionMode(ActionMode p1, Menu p2) { return false; } @Override public boolean onPrepareActionMode(ActionMode p1, Menu p2) { return false; } @Override public boolean onActionItemClicked(ActionMode p1, MenuItem p2) { return false; } @Override public void onDestroyActionMode(ActionMode p1) { } }); } else { edit.setCustomSelectionActionModeCallback(new ActionMode.Callback() { public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } public void onDestroyActionMode(ActionMode mode) { } public boolean onCreateActionMode(ActionMode mode, Menu menu) { return false; } public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } }); }
Обсуждают сегодня