I got the id dynamically as an integer using getIdentifier(). I want to be able to get the value held by the EditText field using the integer id.
I should add this method i’m writing is not within an Activity, it’s in a seperate non-Activity class.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
If you are using a separate class, you should pass a reference to the EditText into that class. First get the reference
then pass it to your other class, and use
getTexton it there. Make sure you only try to access the EditText while the Activity is active.There is a warning for the
getIdentifiermethod, so you should only be using it if you have no other choice: