views:

225

answers:

1

I know how to functionally do each of the following scenarios, my main question is which is the better design decision? Based on app size/speed and battery life and such.

So I will have several activities that will display different lists. They're all lists of the same object, but the objects' states will be different in each of the lists. It will be lists of games, and the games can either be active, finished, or waiting to start. Should I create new activity classes for each of those? Or create one ListActivity class that will just display the different one depending on the intent that was passed? Is there a significant benefit to doing one or the other? Using a different class for each one will be easier to read, but what's the overhead on java for compiling more classes vs having all the same information in 1 class?

A: 

Create a base ListActivity which displays lists.

Then, create separate derived classes for each view mode.

You do want a separate Activity per view. Once a view isn't visible anymore, the OS can reclaim that activity. This helps resource management. Plus, when a view it an Activity it gets to do interesting things in response to user input (for instance, when the search button is hit).

psychotik
I'm retarded. I don't need to subclass a class that extends listview. I just need a listview that takes extras as an intent.
Falmarri