I am accessing an XML source for some records. The XML gets parsed into a data object which in turn gets parsed into a HashMap and the map is passed to a SimpleAdapter which feeds a ListView. All this works well. Now I am ready for the user to change some data and hit submit. There are several screens so they may want to go back to screen 3 from 6 in case they decide to change something. So for example The user changes screen 3-4-5-6. Then on six realizes a typo and goes back to 3 to make the correction.
How can I achieve this? Do I get a handle on the HashMap / SimpleAdapter and update the values in there? This would work for the UI updating instantly (I think) but the data object behind the scenes still has the old data….and my thought was to use the data object to submit the changes.
I could also update the data object but then I would need to rebuild the hashmap and "rebind" (correct term?) the SimpleAdapter to the ListView for the ui to get the changes….
What I learned was that SimpleAdapter is great for STATIC data but if your data is mutable use ArrayAdapter or something else. I refactored to use ArrayAdapter and everything works great with dynamic data changes.