Android ListView in fragment example [duplicate]

2019-03-15 03:01发布

问题:

This question already has an answer here:

  • Android ListView in Fragment 2 answers

Where can I find an example of using ListView in Fragment? I know that there is an example in samples, but unfortunately I could not find it. Maybe you can suggest something?

回答1:

Your Fragment can subclass ListFragment.
And onCreateView() from ListFragment will return a ListView you can then populate.