Hi,
I have a 3 buttons, say LanguageButton, CountryButton and PinCodeButton. When LanguageButton is pressed, I must display a list of languages. Similarly for CountryButton a list of countries and so on. Only one list is to be displayed at a time.
My question is whether it is better to define a single ListView in my layout or 3 separate ListViews for each list in my layout!
I tried to use a single ListView and set corresponding adapters when different buttons are pressed, i.e in onClick()
of languageButton, I give setAdapter(languageArray);
But my doubt arose in implementing the onItemClick()
of the list. Because what must be done whenfirst item is clicked in languageList is different from what must be done in countryList.
Hence that would add to more code in the java file.
So I am just wondering whether I should simplify my onItemClick() code by defining separate ListViews, or should I simplify my layout and add logic to code?
Regards, Kiki