A ListFragment Application with backward compatibility in Android

ListFragment is a fragment class available in the package android.app and it is used to list a set of items in as a listview. Fragment is a new concept which is introduced in Android 3.0 and its higher versions. But we can create applications having fragments for the prior versions of Android till 1.6 using an additional support library. In this article we will create a ListFragment application using this additional support library for Android 2.3.

1. Create an Android Project namely “ListFragmentWithBackward”

Figure 1 : New Android Project

2. Select Android Build target 2.3

Figure 2 : Select Build Target

3. Enter application details

Figure 3: Application Details

4. Add fragment support to the application

Right click project explorer and then click the menu Android Tools -> Add Support library