summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/FastScroller.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/FastScroller.java')
-rw-r--r--core/java/android/widget/FastScroller.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index fb57ce0..00ebe0d 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -468,7 +468,9 @@ class FastScroller {
mListAdapter = (BaseAdapter) adapter;
mSectionIndexer = (SectionIndexer) adapter;
mSections = mSectionIndexer.getSections();
-
+ if (mSections == null) {
+ mSections = new String[] { " " };
+ }
} else {
mListAdapter = (BaseAdapter) adapter;
mSections = new String[] { " " };
@@ -609,7 +611,7 @@ class FastScroller {
final int section = mSectionIndexer.getSectionForPosition(firstVisibleItem);
final int sectionPos = mSectionIndexer.getPositionForSection(section);
final int nextSectionPos = mSectionIndexer.getPositionForSection(section + 1);
- final int sectionCount = mSectionIndexer.getSections().length;
+ final int sectionCount = mSections.length;
final int positionsInSection = nextSectionPos - sectionPos;
final View child = mList.getChildAt(0);