android - How to get FastScroll to work with ExpandableListView? -
I am trying to be able ExpandableListView fast scrolling, and I have tried to solve the solution to this link :
The problem is that when I expand enough groups to trigger the fast scroll bar, I get the Null Pointer Expression error. I tried the following code:
main activity: expandable list = (Vistaryogylistwu) Khojwubiaiaidi (Arkdidkmakspandalebldrishy); Adapter = new adapter (this, list of extensions, category_array); Expandblelist.setAdapter (adapter); Expandblelist.setFastScrollEnabled (true); Adapter: Public Class Adapter Extends Expandable List Adapters Section Idencer, Abselieveview Onscroll lister (private context macontax; private expandable listviewspendablibelview; private list & lt; class & gt; mGroupCollection; private int groupstats; private boolean manual scroll; private string [] group; public adapter (reference reference, expandable listview pxpandablablelist, list & lieutenant ; category & gt; pGroupCollection) {mContext = context; MGroupCollection = pGroupCollection; MExpandableListView = Piakspandabllistwu; GroupStatus = A int [mGroupCollection.size ()]; setListEvent (); this.mExpandableListView.setOnScrollListener (this);} @ScrollStateChanged (AbsListView see Int Scrolstet) on @ public monster; {this.manualScroll = scrollState == SCROLL_STATE_TOUCH_SCROLL;} @ override public void the Scroll (AbsListView scene, integer before Voisaitim, Drishyaitimkount int, int total Aitamkount) {} @ override public int Pojishnforsekshn (iNT section) {if (manual Skall) {return section;} else {return mExpandableListView.getFlatListPosition (ExpandableListView.getPackedPositionForGroup (section)); }} // calls itself manually scrolling the list. Public Inc. received Krensnketforpsn (Int Condition) {return extended Listwukgetpakdposhn Group (Makspandabllistwu.aksakspandabllistposn (status)); } @ Override public string [] getSections () {return group; } LogCat: NullPointerException FastScroller.getThumbPositionForListPosition (FastScroller.java:680) android.widget.AbsListView.invokeOnItemScrollListener (AbsListView.java:1337) at FastScroller.onScroll (FastScroller.java:487)
Can anyone guide me on this? I greatly appreciate your time and support.
Thank you very much
To return your string array "group" Overriding getSections
for, but the array does not appear anywhere from the beginning (unless it has been in the code that you have not posted). In the fastcroller, initialization for the result of mSections
initial call is done so that fastcrollers can try to reach that field so that you can get a NullPointerException; The line is giving you NPE
the last int sectionCount = mSections.length;
Comments
Post a Comment