2

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

enter image description here

user924
  • 8,146
  • 7
  • 57
  • 139

2 Answers2

1

Otherwise disable long click on edittext :

EditText.setLongClickable(false);

or directly in the xml:

android:longClickable="false"
Ashish
  • 6,791
  • 3
  • 26
  • 48
1

JAVA

editTextOBJ.setLongClickable(false);
editTextOBJ.setTextIsSelectable(false);

XML

 android:longClickable="false"
 android:textIsSelectable="false"
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198