How to make Android NOT count ListView's section headers? -


i'm using list: https://github.com/bhavyahmehta/listviewfilter, bu found when have 3 rows in 'a' section , 2 in 'b' section - first row in 'b' section has position 5 instead of 4. how can force not count section headers?

 public int getrealposition(int position){     int sectionheaders = 0;     (integer : mlistsectionpos){         if (position > i){             sectionheaders += 1;         }     }     log.i("asd-truepos", string.valueof(sectionheaders));      return position - sectionheaders; } 

you try override method getcount() pinnedheaderadapter class:

@override public int getcount() {     return mlistitems.size(); } 

you return mlistitems.size() - 1 or calculations in order know if header present or not , return correct value.

if override, in moment in instantiate class or add java class extends pinnedheaderadapter.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -