I\'ve been researching this forever and can\'t find a solution. Everything about my custom list view seems to perform correctly. When I click on the holder.feedUpVoteButto
After continuous trial and error. I finally figured out how to change a textview after it scrolls. My problem was I was getting the wrong ParseObject
value. My main activity contains a ParseQuery
and I was getting the likes
from a Hashmap();
However, for some reason I couldn't pass the value of likes directly so I passed the ParseObject itself. Therefore, needing no query in my BaseAdapter
Class. Then, I implemented these lines of code in GetView();
to answer my original question:
holder.upvote[position] = holder.parseObList[position].getBoolean(ParseUser.getCurrentUser().getUsername() + "upvoteClicked");
holder.downvote[position] = holder.parseObList[position].getBoolean(ParseUser.getCurrentUser().getUsername() + "downvoteClicked");
if(holder.upvote[position] ){
holder.feedUpVoteButton.setBackgroundResource(R.drawable.arrowclicked);
holder.feedNumOfLikes.setText(String.valueOf(holder.likes[position]));
}
else if(!holder.upvote[position]){
holder.feedUpVoteButton.setBackgroundResource(R.drawable.arrowunclicked);
holder.feedNumOfLikes.setText(String.valueOf(holder.likes[position]));
}
if(holder.downvote[position]){
holder.feedDownVoteButton.setBackgroundResource(R.drawable.arrowclicked);
}
else if(!holder.downvote[position]){
holder.feedDownVoteButton.setBackgroundResource(R.drawable.arrowunclicked);
}