I have a ViewFlipper that presents 3 different views.
Is it possible to have 3 classes manage* the 3 different views? If so, how do I go about doing this?
- For example, if View 1 shows a List of News and View 2 Shows a List of Prices, I want to have a News class that handles the interaction of the listview in News, and a Prices class that handles the interaction of the listview in Prices
Why don’t you make your
NewsandPricesclass contain all of your application logic as you said. If you make them extendListViewyou can then add them to yourViewFlipperand treat them in the same way, but they will have the specific behaviour as dictated by whatever you put in theNewsandPricesclasses.Alternatively, just set a different
listView.setAdapter()[to populate], andlistView.setOnItemSelectedListener()[to alter behaviour] for each ListView you have in your ViewFlipper.