Look for a child EditText with the given id. If this view has a given id, return this EditText.
1.In the main.xml file, Name an EditText, myEditText.
2. In the MainActivity.java file, Declare an EditText named myEditText.
3. In MainActivity, java file, add the below highlighted code to the onCreate method. Where R.id.myEditText is the same as the android:id name in your main.xml file, and myEditText is the EditText name referred to in Java.
myEditText = (EditText) findViewById(R.id.myEditText);
4. Compile and run!
Resources: