0

我无法在 android 中的同一活动上打印用户在 editText 中输入的值

4

1 回答 1

0

例如创建 editText 变量

EditText e1;
TextView t1;

在你的 onCreate 方法里面

e1 = (EditText) findViewById(R.id.editText1);
t1 = (TextView) findViewById(R.id.textView1);

t1.setText(e1.getText().toString());

这里 editText1 和 textView1 是您将在 xml 文件中指定的 ID。因此,通常您从 EditText 中获取值并在 TextView 中显示您的完成

于 2015-01-20T09:57:23.960 回答