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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:32:01+00:00 2026-05-18T20:32:01+00:00

just wanted to ask is there a possibility to bind some listener to the

  • 0

just wanted to ask is there a possibility to bind some listener to the ListView scroll event.

What I would like to achieve is that once ListView have been scrolled to the bottom I would like to ask server for more data if any is there.

I know that there is a function like: getLastVisiblePosition() but I assume it must bu used in some kind of listener in order to compare with currently last visible position, am I right ?

cheers,
/Marcin

  • 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-18T20:32:02+00:00Added an answer on May 18, 2026 at 8:32 pm

    Just to extrapolate on TomTo’s answer, some thoughts on how you might do this (theoretical, I haven’t tried this in practice):

    ListView lv = (ListView)findViewById(R.id.list_view);
    lv.setOnScrollListener(new OnScrollListener() {
        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, 
            int visibleItemCount, int totalItemCount) {
            //Check if the last view is visible
            if (++firstVisibleItem + visibleItemCount > totalItemCount) {
                //load more content
            }
        }
    });
    

    Since firstVisibleItem is returns an index (0-based), I increment by one to get the actual item number. Then, if that, plus the number of visible items, is greater than the total number of items, then in theory the last view should be visible. Shouldn’t be a problem, but keep in mind this isn’t called till the scrolling is finished.

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

Sidebar

Related Questions

just wanted to ask is there a possibility to bind some listener to the
Just wanted to ask if there is any advantage for either using mouse click
I just wanted to ask if there was a speedy of dynamically showing thumbnails
I just wanted to ask is there an easier way to get records from
Hi im new to Android and just wanted to ask if there is a
Hy, I would like to ask a question that puzzles me. I've a class
i just wanted to ask if there is a way the reject all changes
I just wanted to ask if there was a secure way to store the
Just wanted to ask you if there is an easy way to add description
Just wanted to ask if there is an easyer way to do this (to

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.