0
myHolder.mName.Text = mEmails[position].Name;

I have been trying to change this xamarin code into Java and when i make it into

 myHolder.mName.getText(mEmails.get(position).getName());

I end up getting red line under the text and this gives me alot of time wasted trying to make it work and am still not yet good in java

4
  • 1
    Show the exact error message. It's not just a red line. Commented Feb 11, 2018 at 17:06
  • 1
    And it looks like your first code sets Text, whereas your Java code tries to getText. Those seem to be opposite of each other. Commented Feb 11, 2018 at 17:08
  • @Carcigenicate, thats why i need some help trying to make it work Commented Feb 11, 2018 at 17:11
  • But you have yet to post the error you're getting. If you need help, don't make it difficult to help you. Commented Feb 11, 2018 at 17:12

1 Answer 1

1

The code you are trying to change "sets" the text and you are doing "get".

Try:

myHolder.mName.setText(mEmails.get(position).getName());

or if mName is a property (change others to "get" also if they are a property instead of a variable)

myHolder.getMName.setText(mEmails.get(position).getName());

and if mEmails is a java array:

myHolder.mName.setText(mEmails[position].getName());
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.