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?
Asked
Active
Viewed 4,709 times
4

Martin Sikjær Olsen
- 43
- 1
- 3
1 Answers
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