How can I copy items from one list to another

Asked

Viewed 70 times

0

I wish to create a listviewwith data from another listview. It will function as a shopping cart of these shopping sites, but will serve another purpose.

On a list there will be

line >imageview, textview, imagebutton

In the other listview

line> Imageview of the first of the first list, textview of the first list and imagebutton to exclude

how can I do that?

I’ve already got the first listview ready-made

  • Where is the Listview data? Is it an Arralist? The second Listview will have the same number of lines as the first?

  • What kind is this list: List, Arraylist, etc?

  • the first is Arraylist, the second I must do the same?

  • If the data of the two lists are the same use the same Arraylist in the two Adapters.

  • no, the second will only receive data if I click the button to add.

  • but only received data from the same button line

  • Then use another Arraylist, add an item to it each time the add button is clicked. Use this Arraylist in the Adapter of the other Listview.

  • this will work with a button right? , and if I have 3 items in the first list? each one will have a button if I click the second or the third, it will work the same?

  • Depending on the implementation, you can have only one button that acts on the selected line or have one button for each line. The Adapter will not be much different from the first list only differs the action of the button(s)).

  • 1

    I’ll try, then give feedback.

  • I need to put something in onclick or I just need to check if it is clicked to add in arraylist 2?

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.