This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
William Kohus
Greenhorn
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?

 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!