tags:

views:

162

answers:

1

Hi All,

I have implemented Section Indexer for an Adapter class which extends BaseAdapter. Now for the first launch Section Indexer is showing an overlay correctly. But when the contents of the list gets updated the Section Overlay does not get updated and gives ArrayOutOfBoundException. For one fix what i did is i made listview.setFastScrollEnabled(false); update the adapter contents; and then listview.setFastScrollEnabled(true); Now what happens is overlay gets updated but the Overlay is coming to the left top of the listview. How can I fix this.

A: 

a small workaround which was suggested by lee.wilmot is

private void jiggleGrid() {

          int newWidth = flag( FLAG_THUMB_PLUS ) ?

FrameLayout.LayoutParams.FILL_PARENT : grid.getWidth() - 1;

          FrameLayout.LayoutParams l = new FrameLayout.LayoutParams(
                          newWidth,
                          FrameLayout.LayoutParams.FILL_PARENT
          );

          grid.setLayoutParams( l );

          toggleFlag( FLAG_THUMB_PLUS );
  }

flag and toggleFlag are some functions.

Call this method after setting setFastScrollEnabled(true);. It worked for me....

skalluraya