How to get EditText value and display it on screen through TextView?

前端 未结 11 1996
南旧
南旧 2020-12-05 12:45

I want to get the user input for the EditText view and display it on the screen through TextView when the Button is clicked. I also, w

11条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 13:12

    I'm just beginner to help you for getting edittext value to textview. Try out this code -

    EditText edit = (EditText)findViewById(R.id.editext1);
    TextView tview = (TextView)findViewById(R.id.textview1);
    String result = edit.getText().toString();
    tview.setText(result);
    

    This will get the text which is in EditText Hope this helps you.

提交回复
热议问题