Here is a method I have:
public static void updateRowForReview(int itemRowPosition) {
adapter.getWasReviewed(itemRowPosition);
updateReviewAtPosition(itemRowPosition);
}
private static void updateReviewAtPosition(int position) {
View view = listView.getChildAt(position - listView.getFirstVisiblePosition());
listView.getAdapter().getView(position, view, listView);
TextView reviewTotalTV =(TextView) view.findViewById(R.id.tvReviewTotalForItem);
String reviewTotal = reviewTotalTV.getText().toString();
int reviewTotalInt = Integer.valueOf(reviewTotal) + 1;
reviewTotalTV.setText(String.valueOf(reviewTotalInt));
}
No matter what I do, the getText().toString()
will only return 1. The TextView
tvReviewTotalForItem
is dynamic and has all sorts of values in each row of the list. So not sure why it returns this. Is my code wrong?
Also note, the position of the row is correct; it sets the text to the right list row, just the wrong value.