Hi everyone i am using custom listview for getting data from server and show in listview.. I am able to get data and show it in listview but i dont know to implement the cli
Currently you have 1 variable per activity to store the quantity. If you want to store it per item, you should add: int qty; to be a member in FeedItem class.
Remove:
convertView.setTag(Integer.valueOf(id));
and similar to plus, you'll need to add:
minus.setTag(item.getId());
Then instead of qty++; or basically in every place in the onClick instead of qty you'll need to use item.qty:
Integer id = view.getTag();
FeedItem item = filteredfeedItems.get(id);
item.qty++;
location.setText(String.valueOf(item.qty));
Update:
I think you're mixing FeedItem.id with position. If you're not changing the order / amount of items in the list then you could ALWAYS use position. Instead of:
minus.setTag(item.getId());
try:
minus.setTag(position);
and the same for plus