I have a ListView (ListViewContacts) and another ListView (ContactList).
When I click on a Button in ListViewContacts I get ContactList, when I select/click a contact in ContactList, this contact is added to the list in ListViewContacts.
This scenario above is what I would like to achieve, though I haven't found the right way to do this.
This is the onListItemClick code for ContactList, this starts the Activity ListViewContact and also gives the clicked contact:
This is part of the onCreate() from ListViewContacts, this retrieves the contact from ContactList and adds it to the ListView:
The problem here is that only 1 contact is added to the list each time, which is the last one that has been clicked on within the ContactList. The code speaks for it self. I assume this happens because a new SimpleCursorAdapter is initiated every time.
What is the best way of adding these contacts, so that the ListViewContacts keeps remembering all contacts and not only the last one that is added? Thanks in advace.