1

I want to add multiple listview like one app for twitter for android : link But eveytime i try to add multiple listview in the XML and populate it there is just the first one that appear . Do you have an explanation ?

Tsunaze
  • 3,204
  • 7
  • 44
  • 81
  • You probably have them in a `LinearLayout` with height set to fill the parent. Try giving them 0 height and 1 weight each. – entonio Jun 19 '11 at 18:53

2 Answers2

1

Try this:

<LinearLayout android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical">

<ListView android:id="@+id/list1"
      android:layout_height="0"
      android:layout_width="fill_parent"
      android:layout_weight="1" />

<ListView android:id="@+id/list2"
      android:layout_height="0"
      android:layout_width="fill_parent"
      android:layout_weight="1" />

</LinearLayout>

You can put any number of listviews as long as you define the height of each to be 0 and weight 1. Hope that helps. Have fun!

Srichand Yella
  • 4,218
  • 2
  • 23
  • 24
0

I don't know how that twitter app works, but this can be easily done using fragments. Subclass ListFragment and then add as many fragments as you want in your Activity.

aromero
  • 25,681
  • 6
  • 57
  • 79