views:

46

answers:

2

It seems that android has enforced that a listview must have the name android:id="@android:id/list", is there anyway to create multiple listview then? I have two activities which are both listview but have to control different format of Lists, one with image+text the other is just text.

+1  A: 

The id does not have to be android:id="@android:id/list". You can specify any id by android:id="@+id/thingsandalsootherthings"

jqpubliq
Is that true? Check out what synic said in this post: http://stackoverflow.com/questions/2661073/android-how-to-specify-multipe-listivews
Yang
The link you have there is to this question. You only use `android:id="@android:id/list"` for one `ListView` in a `ListActivity`. If you want your `ListActivity` to have two `ListViews`, then name the second one something else, then use it like a regular widget (e.g., `findViewById()` to get the `ListView`).
CommonsWare
+1  A: 

Extend Activity (instead of ListActivity) and inflate a layout with any number of ListViews you like.

alex