We all know we can setText(String) to an editText box but if you want to get an editable variable from a string variable how do you do this?
For Temp I made an invisible editText box to set to then get from which turns the string into editable.
re: for my own reference String again = editablevariable.getText().toString()
say etUserName is an EditText,
When you want to get a text from it:
val strUserName = binding.etUserName.text.toString()
then, when you have to set the text to it
binding.etUserName.setText(signupFormParcel.strEmail)
but you can't do the following directly:
binding.etUserName.text = signupFormParcel.strEmail
so you do:
binding.etUserName.text = SpannableStringBuilder(signupFormParcel.strEmail)
where strEmail is a string. – Abhinav Saxena Aug 26 '21 at 11:48