Java to Kotlin – Set Text on EditText
One of big change from Java to Kotlin is Kotlin often not use get/set for manipulate their property like Java. For example on EditText you need this code on Java for get or set EditText:
editName.setText("Your string.."); String name = editName.getText().toString();
and Kotlin have a property like this for get text:
We will think we need this code for set text:
editName.text = "Your string.." // This will give an error
It wil fail.. we need change the code to:
And run well..