-1

I want to set data from my editText which has integer typedata. if it is string, we can make setTake, but how we can implement it at integer?

The warning is

None of the following functions can be called with the arguments supplied. setText(CharSequence!) defined in com.google.android.material.textfield.TextInputEditText setText(Int) defined in com.google.android.material.textfield.TextInputEditText

uul
  • 9
  • 5
  • you can type cast the integer to the String – Ajay K S Jul 01 '22 at 11:43
  • it doesn't work. because the warning is None of the following functions can be called with the arguments supplied. setText(CharSequence!) defined in com.google.android.material.textfield.TextInputEditText setText(Int) defined in com.google.android.material.textfield.TextInputEditText – uul Jul 01 '22 at 11:59

1 Answers1

0

Your code shows data is of type UserDto. I don't know what that class looks like but it has a field called phoneNumber. This is what you are passing to setText(). I can't tell what type this phoneNumber is because you haven't shown us your UserDto class but the error tells us that it's neither an Int nor CharSequence, which it needs to be. You can try to do this maybe to make it work

binding.etPhone.setText(data.phoneNumber.toString())
Ivo
  • 18,659
  • 2
  • 23
  • 35