Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding Values from ArrayList<Object> to an EditText field.  RSS feed

Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 11 Gives me the following Error:
Unable to start activity ComponentInfo{bteamdevelopment.contactinformation/bteamdevelopment.contactinformation.ContactActivity}: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0

I'm able to Toast tvalues in line 13 and it prints each of my values so I know ArrayList<> values has items in it. It's weird because it's telling me it's an invalid index and the size is 0!??

Also, I'm able to print ALL of my results from the ArrayList if I use:
editAddress.setText(values.toString()); - That will populate my (EditText)editAddress with ALL of my values.

I guess my question is how do I pull a SINGLE value from the ArrayList and set it to my EditText?

Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!