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

前端 未结 11 1998
南旧
南旧 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:09

    First get the value from edit text in a String variable

    String value = edttxt.getText().toString();
    

    Then set that value to textView

    txtview.setText(value);
    

    Where edttxt refers to edit text field in XML file and txtview refers to textfield in XML file to show the value

提交回复
热议问题