4

I'm new to Android development, and have been able to set the text of EditText elements through XML code, but how can I do it in code?

1 Answers1

8

Simply call the setText() method. Here is an example:

EditText e = (EditText) findViewById(R.id.editText);
e.setText("New Text");
slayton
  • 20,123
  • 10
  • 60
  • 89