Activity file
public class Mainactivity extends Activity implements View.onclicklistener {
Private EditText EditText;
Private TextView TextView;
public void OnCreate (Bundle saveinstancestate) {
Super.oncreate (saveinstancestate);
Findviewbyid (R.id.button). Setonclicklistener (this);
EditText = (editText) Findviewbyid (R.id.edittext);
TextView = (TextView) Findviewbyid (R.id.textview);
}
public void OnClick (View v) {
Textview.settext (Edittext.gettext ()); // !
}
}
Here is the Main.xml layout file code:
<?xml version= "1.0" encoding= "Utf-8"?
<linearlayout xmlns:android= "<a href=" http:/ Schemas.android.com/apk/res/android ""
target= "_blank" >http://schemas.android.com/apk/res/android "</a
android:orientation= "vertical"
android:layout_width= "fill_parent"
android:layout_height= "Fill_ Parent "
;
<textview
android:layout_width=" fill_parent "
android:layout_height=" Wrap_content "
android:text= "@string/hello"
/>
<!--create a EditText-->
<edittext
android:id= "@+id/ EditText "
android:layout_width=" 149px "
android:layout_height=" wrap_content "
android:textsize=" 18SP "
android:layout_x= "29px"
android:layout_y= "33px"
/>
<!--establish a TextView-->
<textview
android:id= "@+id/textview"
android:layout_width= "135px"
android:layout_height= "41px"
Android: layout_x= "33px"
android:layout_y= "106px"
/>
</linearlayout>
Android development inside how to click on the button will edittext inside the content displayed in TextView (code not pro-test, if there is insufficient, please leave a message!) )