views:

83

answers:

1
A: 

So how can I make the section headers fixed after creating the headers?

Have isHeaderVisible() work properly, I guess. Near as I can tell, that is where your problem lies.

Why setViewBinder been called while scrolling?

Because rows are recycled when they are scrolled.

CommonsWare
Ya, the isHeaderVisible() may got problem, because the comparison of preDate and dateString. preDate is used to check whether 2 items are different date. when first called, preDate will change to last record date in the end. But when scroll screen, the list of records are not called in sequence like I mentioned above. The first record always show its title as header. the rest records compare with previous record if date diff then set title visible, use if(preDate.equals(dateString)) {view.setVisibility(View.VISIBLE); prevDate = dateString; } This only works well when set up the listView.
Wen
Problem is how to define preDate so that it can keep track while scrolling.
Wen