user1360909 user1360909 - 1 month ago 18
Java Question

Android - default value in editText

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

Answer

You can use EditText.setText(...) to set the current text of an EditText field.

Example:

yourEditText.setText(currentUserName);