Get text string from EditText?

后端 未结 3 1142
北恋
北恋 2020-12-29 18:08

It seems I can\'t figure out how to get the text string out of EditText. I want to use the text from the EditText at pressing the button.

l

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 18:42

    Try this :

    EditText edt = (EditText)findViewById(R.id.edittext);
    String xyz = edt.getText().toString();
    

提交回复
热议问题