We can disable editing text in EditText like this https://stackoverflow.com/a/8942552/7767664d
EditText.setFocusable(false)
But still we can paste some text to this view when you do long tap on it and paste button pops up
We can disable editing text in EditText like this https://stackoverflow.com/a/8942552/7767664d
EditText.setFocusable(false)
But still we can paste some text to this view when you do long tap on it and paste button pops up
Otherwise disable long click on edittext :
EditText.setLongClickable(false);
or directly in the xml:
android:longClickable="false"
JAVA
editTextOBJ.setLongClickable(false);
editTextOBJ.setTextIsSelectable(false);
XML
android:longClickable="false"
android:textIsSelectable="false"
edittext.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;
}
});