My Android app needs to populate the ListView using the data from an ArrayList.
I have trouble doing this. Can someone please help me with the code?
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 need to do it through an
ArrayAdapterwhich will adapt your ArrayList (or any other collection) to your items in your layout (ListView, Spinner etc.).This is what the Android developer guide says:
So your code should look like: