Create a new App to understand Fragment Concepts – Part 2

In Part 1 you created a new App from Scratch. Now its time to create two things

  1. ListFragment : To display List of Data.
  2. Employee Class : Which will provide us the data to be displayed.

Follow along the video to do this.

Source Code for the changes are available here

Learn how to display a List of Items in a Fragment using ListFragment

You have seen how to use ListActivity to display a List of items in an Activity. Similar to that we have a ListFragment which can be used to display a List of items in a Fragment.

The advantages of using a ListFragment are:

  • You don’t have to create a Layout XML file. You can if you want.
  • You don’t have to create an EventListener.

To learn more please watch the Video.

Source Code available here