Android GCM / Listview updating

Viewed 69

I am currently displaying a list of items for users to upvote and downvote based on the amount they like that item.

Say for instance there are 3 different items, Task 1, Task 2, Task 3, each has 0 votes on it. When I upvote on one item, I would like it to go above the other and if I downvote it go below the other one. I got this to work perfectly through a list adapter and a custom class that extends BaseAdapter, the only problem I have now is that, if I'm on my own client and I upvote an item while a different user also is upvoting an item, it will refresh my list and it won't show that the local user clicked the item anymore so they can vote unlimited amount of times.

I currently have 2 Arraylists, one with all of the items, and one with only the items that are clicked and whether they were upvoted or downvoted. I thought possibly calling .notifyDataSetChanged() would fix the issue, but currently it just isn't working.

I use GCM currently to send the host user a message saying their was an upvote or downvote, the main host upvotes / downvotes the item and sends the new list to all of the other clients.

If any code would be necessary to see just ask, thank you for the help.

1 Answers
Related