Complex Items in a Listview
<p>I have a ListView where the view for each item is a string (the name of the item).  But I have to associate a lot of other data with that item: price, size, weight, tax, etc.  So, I'm of creating a new Java class called Item, and then an object for each item in the list.</p>

<p>I don't know which is the bext way to implement this.  There's two obvious choices:</p>

<p>1) I can simply create the data structure outside of any Android Views, and then write a method called UpdateList() which takes the name of each item in this data structure and puts it in the ListView.  The problem with this is that some of the data is duplicated twice (the original data structure, and the adapter for the ListView) and when you duplicate data, bug potential arises.</p>

<p>2) Or, I can somehow associate the data structure directly with the adapter for the ListView and have it figure out how to display the name for each ListView entry that is displayed.  The advantage here is that you only have a single data structure.  But I don't know if this is possible in Android, or very complex.</p>

<p>Which is the preferred way to do this with Android apps?</p>
