In my app I have an edit user details page and I want to display the current name, email address etc in the corresponding editText fields and then the user can just erase that and enter a new one if they want.
Is there a way to do this? Thanks for any help
You can use the setHint() to set it, or set it in XML (though you probably don't want that, because the XML doesn't 'know' the name/adress of your user :) ) Show activity on this post. You can use EditText. setText(...) to set the current text of an EditText field.
Do this: editText. setText("Your default text");
There is the hint
feature? You can use the setHint()
to set it, or set it in XML (though you probably don't want that, because the XML doesn't 'know' the name/adress of your user :) )
You can use EditText.setText(...)
to set the current text of an EditText field.
Example:
yourEditText.setText(currentUserName);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With