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

  • SEARCH
  • Home
  • 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 7627731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:29:58+00:00 2026-05-31T05:29:58+00:00

How is it possible to make a smooth setSelection(position) for listFragment. For regular listviews

  • 0

How is it possible to make a smooth setSelection(position) for listFragment. For regular listviews it is possible to call smoothScrollToPosition(position) but this only works for api lvl 8 and above but this doesn’t matter because it doesn’t work for listfragment and not down to api lvl 7.

Any ideas, suggestions that will help implement this is greatly appreciated.

  • 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-05-31T05:29:58+00:00Added an answer on May 31, 2026 at 5:29 am

    Mark D is correct that, if you want to smooth scroll the ListView in a ListFragment, you need to call getListView() on the ListFragment and then call smoothScrollToPosition(int) on the ListView that is returned. Of course, this only works down to API level 8 because that is when smoothScrollToPosition(int) was introduced to AbsListView, the superclass of ListView.

    I suppose you could look at the code in AbsListView.java to see what it does and try to replicate it in your own subclass of AbsListView or ListView. It’s immediately clear that smoothScrollToPosition(pos) just calls start(pos) on an instance of an inner class PositionScroller, but it looks somewhat complicated to replicate that behavior in your own subclass since the PositionScroller gets called from a several other spots like onDetachedFromWindow(), public void onWindowFocusChanged(boolean hasWindowFocus). It’s not at all clear to me how you would cleanly integrate your PositionScroller behavior into your subclass based on the API 7 version of AbsListView.

    If it were my decision, with API 7 and earlier making up less than 8% of devices accessing the Android Market in the latest data set, I’d just punt and do something simpler like setSelectionFromTop whenever the API is lower than 8 (detected by Build.VERSION.SDK_INT).

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

Sidebar

Related Questions

is possible make insert in the table with only one column and this column
Is it possible to make efficient queries that use the complete regular expression feature
Is that possible? How is this done in theory? Would I simply make a
there is possible make something like this in php ? <script type=text/javascript> for(i=0; i<5;
Is it possible make some handler that will do something when user shutdown computer
Is it possible make an activity, that will lock the android device? That device
Possible Duplicate: Make iPhone app paid version replace free version on install from app
is possible to make own help message or attach own event on help option
How is it possible to make prototype methods in C#.Net? In JavaScript, I can
Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0?

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.