Search code examples
androidlistviewfavorites

Save ListView Item and use it in another ListView?


I am trying to create add to Favorites function. I have 2 ListView's, 1 normal and 1 for favorites. For example, if user wants to add to favorites some item from normal ListView I want to take data from that ListView Row and show it in Favorites Listview. What is the way to do this? The ListView is using Array Adapter


Solution

  • Could you post some code?

    Either way, basically what you do is: Get the selected item from your first ListView and add it to the ArrayAdapter of the second ListView.

    Once you've done that you call the notifyDataSetChanged on the second ListView

    Edit:

    A good link for basic options of data storage in Android: Storage Options