Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9249111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:06:38+00:00 2026-06-18T10:06:38+00:00

In android setFastScrollEnabled(true); is used for making ListView fast scroll. This fast scroll does

  • 0

In android setFastScrollEnabled(true); is used for making ListView fast scroll.

This fast scroll does not work when there are less items in ListView. I read it somewhere that fast scroll in android works only when listview total height is 4 times or more than listview visible height. I have spent hours trying to find it in framework source code, but I am not able to find it.

Can someone point me to place in android framework source code where this condition to disable fast scroll when there are less items in ListView.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:06:40+00:00Added an answer on June 18, 2026 at 10:06 am

    Yes ofcourse, here is the link:

    http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/android/widget/FastScroller.java

    This is a condidion between lines 224-227. And for setting how many pages it will be needed to show fast scroll, there is a constant:

    private static int MIN_PAGES = 4;
    

    And about disabling it… It’s a private field so there is no simply way to do it. You can try use reflections or create custom FastScroller based on original.
    But i think the simpliest way is to check like in this condidion in Android code:

    //pseudocode
    int numberOfPages = listView.itemsCount / listView.visibleItemsCount;
    if(numberOfPages > yourValue)
        listView.setFastScrollEnabled(true);
    else
        listView.setFastScrollEnabled(false);
    

    But it may only work if yourValue will be greater than 4. If you want to do it for less values then you need to use reflection or create custom class.

    EDIT:

    For newest version there is the link:
    http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/widget/FastScroller.java/

    And lines are 444-447 🙂

    And for reflections I would try something like this:

    try {
    Field scrollerField = AbsListView.class.getDeclaredField("mFastScroller");    //java.lang.reflect.Field
    scrollerField.setAccessible(true);
    FastScroller instance = scrollerField.get(listViewInstance);
    
    Field minPagesField = instance.getClass().getDeclaredField("MIN_PAGES");
    minPagesField.setAccessible(true);
    minPagesField.set(instance, yourValue);
    } catch (Exception e) {
    Log.d("Error", "Could not get fast scroller");
    }
    

    It’s not tested so i don’t know if it really works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

android:layout_gravity=center doesn't seem to work the same in a RelativeLayout as it does in
Android does not support ad-hoc WiFi networks. My question is, how can it distinguish
Android does not allow native apps like Phonegap-based apps to write binary files. A
Android 3.1 (API 12) - Strict, this is a commercial app and will not
Android OpenGL-ES VBO support or not? How can i check this? Thanks
Android 2.3.3 I have an OptionsMenu. There are 5 - 6(not yet decided exactly)
Android does not have main loop, but I have a ball in my arkanoid
Android 2.x does not play mp4 with H.264 baseband from scratch. However, some apps
Android comes with lots of system resources ( android.R ) that can be used
Android 4.1.2. I have a LinearLayout with a ListView child. I add 20 rows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.