0
I wish to create a listview
with 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 andimagebutton
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?
– ramaral
What kind is this list: List, Arraylist, etc?
– viana
the first is Arraylist, the second I must do the same?
– Carlos Alberto
If the data of the two lists are the same use the same Arraylist in the two Adapters.
– ramaral
no, the second will only receive data if I click the button to add.
– Carlos Alberto
but only received data from the same button line
– Carlos Alberto
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.
– ramaral
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?
– Carlos Alberto
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)).
– ramaral
I’ll try, then give feedback.
– Carlos Alberto
I need to put something in onclick or I just need to check if it is clicked to add in arraylist 2?
– Carlos Alberto