I'll show you the example in Java.
You must create a variable in your activity class
EditText editName;
then you must override the onCreate() method of the Activity
class:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
editName = (EditText) findViewById(R.id.editName);
}
overriding the onCreate()
you can take a reference to your EditText.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…