skip to Main Content
[enter image description here][1]

Hello everyone I am not getting this option .get Text() when I write it is showing wrong in android studio please help help
[1]: https://i.stack.imgur.com/UF227.png

2

Answers


  1. Your Emailbox is of type View:

    private View Emailbox;
    

    The View class in Android, doesn’t have any getText() methods, hence that error. So most likely your field should be defined of type EditText:

    private EditText Emailbox;

    As the other fields are, and not as a View.

    P.S. All elements in Android are views, meaning that each class extends the View class.

    Login or Signup to reply.
  2. You can use EditText instead of View.
    To get text programmatically using getText() method

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search