1. Add a textview control in the res/layout/activity_my.xml after the EditText control:
<textview>
android:id="@+id/text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" /></textview>
2. add an onclick listener to the Button control:
<button>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage" /></button>
3. Lastly, in the MyActivity.java:
// Called when the user clicks the Send button
public void sendMessage(View view) {
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
TextView textView = (TextView) findViewById(R.id.text_id);
textView.setText(message);
}