Reputation: 1266
I'm wondering, because I have occasion to use two different activities that both use listviews and obviously I can just make one a normal activity with a listview, but I checked the api, and there was no mention of this....
I tried using two listActivities just normally but, it seems there is a conflict because both listviews in each activity have to be named list, so there is still only one "list" id in the R file...
anyone know if its possible to use two?
Upvotes: 0
Views: 437
Reputation: 61351
The ListView
object's ID should be indeed list
, but you can have several layout files (with arbitrary names) with such an object inside. So yes, you can have as many ListActivities in the project as you wish. Derive your own classes from ListActivity
, and use setContentView()
to feed the right layout file to it.
Upvotes: 1