ListFragment
-
a subclass of Fragment
-
contains a ListView
-
you can insert multiple instance of a ListFragment into your normal Activity (not ListActivity)
- EXAMPLE: a horizontal LinearLayout Activity containing 2 side by side (horizontally layed out) ListFragments
- (see Books/Android/Source Code/ListFragmentExample)
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" >
<fragment android:name="net.learn2develop.ListFragmentExample.Fragment1" android:id="@+id/fragment1" android:layout_weight="0.5" android:layout_width="0dp" android:layout_height="200dp" />
<fragment android:name="net.learn2develop.ListFragmentExample.Fragment1" android:id="@+id/fragment2" android:layout_weight="0.5" android:layout_width="0dp" android:layout_height="300dp" />
</LinearLayout>