I will assume that you have written two Activity classes: ActivityA
& ActivityB
and that you have written the onClickListener
for the button in ActivityA
.
To pass data between two activities, you will need to use the Intent class via which you are starting the Activity and just before startActivity for ActivityB, you can populate it with data via the Extra objects. In your case, it will be the content of the editText.
ActivityA onClickListener
Intent i = new Intent(getBaseContext(),ActivityB.class);
//Set the Data to pass
EditText txtInput = (EditText)findViewById(R.id.txtInput);
String txtData = txtInput.getText().toString();
i.putExtra("txtData", txtData);
startActivity(i);
Now in ActivityB, you can write code in the onCreate to get the Intent that launched it and extract out the data passed to it.
ActivityB onCreate
Intent i = getIntent();
//The second parameter below is the default string returned if the value is not there.
String txtData = i.getExtras().getString("txtData","");
EditText txtInput2 = (EditText)findViewById(R.id.txtInput2);
txtInput2.setText(txtData);
Hope this helps.