1

It's the same function when I jumped to the implementation of the function.
What are they different for under the hood?

To use textView.setText("str") with TextView is okay.
But to use editText.setText("str") with EditText is not okay, even if setText(...) is the same.

In case of EditText I have to use setText("str").
What's the reason for that in Kotlin?

Tugay
  • 2,057
  • 5
  • 17
  • 32
libliboom
  • 532
  • 5
  • 17
  • What is `EditTextView`? You meant `EditText`? – Tugay Nov 11 '20 at 13:53
  • `EditText` is right. I'll edit it. – libliboom Nov 11 '20 at 13:54
  • is this answer your question https://stackoverflow.com/questions/57056445/what-is-the-difference-between-textview-settextstring-and-textview-text-str/57056861 – Mohammed Alaa Nov 11 '20 at 14:10
  • Does this answer your question? [Setting text in EditText Kotlin](https://stackoverflow.com/questions/44493908/setting-text-in-edittext-kotlin) – Tugay Nov 11 '20 at 14:11
  • It's because of the naming of `text` so it guess not `public final void setText(CharSequence text)` of TextView but `public Editable getText()` of EditText because of synthetic property. Got it! Thanks for everyone. – libliboom Nov 11 '20 at 14:29

0 Answers0