The method getText() is undefined for the type String error

后端 未结 3 1485
野趣味
野趣味 2021-01-29 12:48
 String email = email.getText().toString();

Please help getting error The method getText() is undefined for the type String

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-29 13:10

    Assume the id of your EditText is email. To get the Text of the EditText you can use

    String email = ((EditText)findViewById(R.id.email)).getText().toString();
    

提交回复
热议问题