HeaderListView icon indicating copy to clipboard operation
HeaderListView copied to clipboard

SectionAdapter.numberOfRows gets section == -1

Open seriousmike opened this issue 11 years ago • 4 comments

When scrolling variable section==-1 is passed method numberOfRows. Correct section numbers are also passed to this method, and it is not a big problem to check section in method body but this -1 is very unexpected.

Also, in Demo example we cannot watch such behavior cos` for every section (whatever it is) method returns 35, even for section -1

seriousmike avatar Nov 26 '14 17:11 seriousmike

I am also noticing this same behavior

aaearon avatar Dec 01 '14 12:12 aaearon

Lame, but it works for me. For the time being ...

@Override public int numberOfRows(int section) { if(section == -1) { System.out.println("Why???"); return 0; } return children.get(section).size(); }

sirkalmi avatar Dec 08 '14 12:12 sirkalmi

same here

marckaraujo avatar Dec 18 '14 18:12 marckaraujo

I had to verify if section passed was -1 and return 0.

KunamiPT avatar Jun 22 '15 10:06 KunamiPT