-1

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
  • 11
  • 3
  • 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
  • 332
  • 1
  • 11
0

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

Zain
  • 37,492
  • 7
  • 60
  • 84
saleem
  • 11
  • 3