I created a ListView that uses FastScroll . (see pic.) When the user clicks any of the buttons below (all tracks, artists, album), every time the next custom ArrayAdater is called
ArrayAdapter<String> adapter = new ScrollIndexListAdapter(Listing.this, elements); //Code for ScrollIndexListAdapter is below
and updated the same ListView.

PROBLEM . According to my research on Android, the getSections() method is called only once (i.e. only when ScrollIndexListAdapter is called )
This time the sections fill up, and fastScrolling works fine.
But when I update the ListView by clicking on Artistists / Album, the getSections() method is not called. Thus, older sections are used, and FastScrolling still shows previews of old alphabets.
So, how can I update sections every time a ListView is updated?
There is a setSections() method, but I cannot find how to use it.
Code for the ScrollIndexListAdapter class:
public class ScrollIndexListAdapter extends ArrayAdapter implements SectionIndexer {
reiley
source share