The question is published on by Tutorial Guruji team.
I am attempting to perform a simple mathematical operation on one editText field which changes the value of another editText field (a unit conversion calculator).
inchesEditText.setText(String) = (metersVal.toString().toDouble() * metersToInchesVal).toString()
The following error was returned when setting the text of the editText field:
Error:(24, 28) None of the following functions can be called with the arguments supplied: public final fun setText(p0: CharSequence!): Unit defined in android.widget.EditText public final fun setText(p0: Int): Unit defined in android.widget.EditText
Any help would be much appreciated. Thanks
you need to do something like below. If you want to set value in EditText then you have to set value inside
yourvalue must be in
String format. check below,
inchesEditText.setText( (metersVal.toString().toDouble() * metersToInchesVal).toString() )