0

how to make an editText not editable and how to make it editable again I want the solution in kotlin code I tried (editText.isFocusable = false) it works but when i want it editable again (editText.isFocusable = true) does not make it editable again

saleem
  • 1
  • 1
  • It is not a duplicate of that one because that one is about XML, and this one is about changing it in Kotlin. – Tenfour04 Oct 08 '21 at 20:04

2 Answers2

2

You need to do that

yourEditText.setEnabled(false);
Spectator
  • 164
  • 7
0

I tried (isFocusableInTouchMode = true) it does make the EditText editable again. And I use isFocusable = false when I want it not editable

Zain
  • 25,701
  • 7
  • 36
  • 61
saleem
  • 1
  • 1