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 7969885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:18:29+00:00 2026-06-04T07:18:29+00:00

I have a list view in my app which shows 10 items initially, and

  • 0

I have a list view in my app which shows 10 items initially, and when i scroll to the bottom, it dynamically adds 10 items every time. My problem is when i scroll to the bottom, the display goes to the 1st item in the list(not the newly added 10 items), so i need to scroll all the way down.

I used

ListView.setSelection(totalItemCount - 9);

to display the 1st item of the newly added 10 items. But here what happens is the display goes to the 1st item of the listview actually, but again it automatically scrolls to the 1st item of the newly added 10 items. so, the ux will be bad here….i want it to change so that it whould not go to the top of the listview. hope i explained it clearly, please help, thankyou

  • 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-04T07:18:30+00:00Added an answer on June 4, 2026 at 7:18 am

    When you scroll down and start getting new data you should store your Last Visible Position in some variables using this method :

    int firstVisiblePosition = listView.getFirstVisiblePosition();
    

    Edit
    Try this :

    View view = listView.getChildAt(0);
    int distFromTop = (view == null) ? 0 : view.getTop();
    

    Then after you completed loading data you should set this position using :

    listView.setSelectionFromTop(firstVisiblePosition, distFromTop);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list view contains 100+ rows. every time the user opens the
I have a list view in which I can insert items(the items are inserted
I have an Android app with a ListActivity in the main view. The list
I have a list view with over 100 items. Each of these items show
I have chat list view in which sender name should be left aligned and
Here's the problem. In my app, I have 5 tabs which contains activities. In
In my app I have the WebView which shows html files. So I want
I have a web app which displays a list of emails that need to
I have a long ListView which contains a list of actions which my app
I have a tab in my tab based app which shows Google Maps. It

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.