I have a ListView which is populated from a string-array resource. I’m trying to figure out how I can use a key-value type of structure, so that the key is displayed in the ListView, and when a row is selected I can get the value.
I know I could maintain a separate array for the values and do a lookup using the selected index of the row but this is hard to maintain.
Also I think I could make a POJO and build the list with those objects with my own custom list adaptor, but I want to just use a simple xml file if possible.
I’m reading the documentation to see if I can do this in xml but I’ve not found anything like this yet?
Thanks for you time.
I have just created a bunch of POJOs and used a custom list adapter to display the relevant data from the Object in the List Row.