I have a long "cities" list. I was looking for an equivalent to sectionIndexTitlesForTableView in the iphone world. It provides a way to "jump" to a particular point in long lists without having to scroll through all the elements. I think FastScrollView implements this but it's not part of the API and I can't find any documentation on how to use it. It appears in the baked in contacts application of the device. I want to use this functionality within an AlertDialog. Is this possible?
2 Answers
Fast scroll can be used for any list; the most common being the alphabetical lists. You can write your own custom SectionIndexer for other fast scrolling operations such as moving to a list based on some other attribute of your list item (e.g. name, address - where section indexer will be alphabetical, and phone number, address etc where it can be numerical)
P.S. This is more of a comment aimed at matto1990's answer.

- 1,555
- 1
- 13
- 24
Fast scroll is something you can only use in alphabetical lists really. The view which pops up (to show where you are) can only provide space for a single letter. I've looked in the source code for ways to extend it, however lots of the methods needed are protected and can only be used by classes in the same package (the core framework one).
The only thing I can think to do is to just write it all yourself. It's annoying but until Google make it possible for us to extend it via an API that's the best that's possible.
-
I am only interested in alphabetical lists (for the time being). The generic version would be nice in other contexts though. Is there good example code for a simple alphabetical list? – Osmund Aug 19 '10 at 16:24
-
1The easiest way is to just call setFastScroll(true) on your ListView – matto1990 Aug 19 '10 at 17:53
http://stackoverflow.com/questions/5122749/create-easy-alphabetical-scrolling-in-listview – Mathayo Aug 17 '12 at 14:35