Android ListView in Fragment

simplified. picture simplified. · Jun 28, 2011 · Viewed 51.6k times · Source

I am trying to create a list of items which contains an image and some description for the image in each individual. After which, the list will be place in a fragment inside the application. Can anyone guide me to create it? I am not too sure how can I do it without the ListActivity.

Answer

citizen conn picture citizen conn · Jun 28, 2011

It seems like your Fragment should subclass ListFragment (not ListActivity). onCreateView() from ListFragment will return a ListView you can then populate.

Here's more information on populating lists from the developer guide: Hello, ListView