Set the Text in an EditText, in java

How to Set the Text in an EditText, in code, Step-By_Step

1. If you don't have an Android Project already, create an Android Project.

2. Make sure you have added your EditText to your project.

3. Open the MainActivity.java file and add the below line to the import section.

import android.widget.EditText;

3. Add the setText line of code to set the text. You may add it to the onCreate to test it.

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
EditText myeditText = (EditText) findViewById(R.id.editText);
       myeditText.setText("This is the new text!");
 }

4. Compile and run!