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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:35:54+00:00 2026-06-05T05:35:54+00:00

In my android application, I have a scroll view which has a lot of

  • 0

In my android application, I have a scroll view which has a lot of children view.
How can I listen for an event when a view is switching from visible to ‘non visible to user’ due to user’s scroll action?

  • 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-05T05:35:56+00:00Added an answer on June 5, 2026 at 5:35 am

    So the default ScrollView does not provide any sort of scroll listener, but it does call onScrollChanged() when the user scrolls, so you can implement your own:

    public class YourScrollView extends ScrollView {
      private ScrollListener scrollListener;
    
      ... // constructors etc
    
      public void setScrollListener(ScrollListener scrollViewListener) {
        this.scrollListener = scrollViewListener;
      }
    
      @Override
      protected void onScrollChanged(int x, int y, int oldx, int oldy) {
        super.onScrollChanged(x, y, oldx, oldy);
    
        if (scrollListener != null) {  //I don't care about the direction, you might.
          scrollListener.onScrollChanged(); 
        }
      }
    
      public static interface ScrollListener {
        public void onScrollChanged();
      }
    
    }
    

    Now in your onScrollChanged you can go through your Views and check if they are visible:

    int[] location = {0,0};
    view.getLocationOnScreen(location);
    
    //container height is the height of the scrollview
    if (location[1] + view.getBottom() < 0 || location[1]  > containerHeight) {
      //your view is not visible
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a view in my Android application which should scroll both horizontal
I would like to develop an Android application which will have a local database.
I have an android application in which I have to execute some tasks at
I am currently working on an Android tablet application which has two fragments, a
I have applied scroll view to the entire layout and that layout has one
I'm having a strange problem with Android 1.6 I have an application that has
I'm trying to use Android GalleryView to implement a view that can scroll horizontally
I'm creating an android application, which has a particular screen (layout) with over (120+
In my Android Application I have a Google MapView Activity and I am facing
i am developing an arabic android application and i have the compatibility package referenced

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.