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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:08:53+00:00 2026-05-26T06:08:53+00:00

I am using TableLayout. which have 100 of items to make it scrollable I

  • 0

I am using TableLayout. which have 100 of items to make it scrollable I am using Tablelayout inside ScrollView. But I have to detect whether the user have scrolled to the last row. If the user have scrolled to the last view then user will be shown a Toast message.
But How to know that the user has scrolled to the last row of the tablelayout. I have referred the code from TableLayout inside ScrollView.

http://huuah.com/using-tablelayout-on-android/

  • 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-26T06:08:54+00:00Added an answer on May 26, 2026 at 6:08 am

    If new scrolled y position + scroll view height >= tableview height that means you have reached the end of list.

    To achieve this you have to write your custiom scrollview.

    Step-1 You have to create custom scroll view extending ScrollView

    package com.sunil;
    import android.content.Context;
    import android.util.AttributeSet;
    import android.widget.ScrollView;
    
    public class LDObservableScrollView extends ScrollView {
    
        private LDObservableScrollViewListener scrollViewListener = null;
    
        public LDObservableScrollView(Context context) {
            super(context);
        }
    
        public LDObservableScrollView(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
        }
    
        public LDObservableScrollView(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
    
        public void setScrollViewListener(LDObservableScrollViewListener scrollViewListener) {
            this.scrollViewListener = scrollViewListener;
        }
    
        @Override
        protected void onScrollChanged(int x, int y, int oldx, int oldy) {
            super.onScrollChanged(x, y, oldx, oldy);
            if(scrollViewListener != null) {
                scrollViewListener.onScrollChanged(this, x, y, oldx, oldy);
            }
        }
    
    }
    

    Step-2 Create a Listener to detect scrollchanged

    package com.sunil;
    import LDObservableScrollView;

    public interface LDObservableScrollViewListener {
    
        void onScrollChanged(LDObservableScrollView scrollView, int x, int y, int oldx, int oldy);
    
    }
    

    Step-3 in layout xml instead of ScrollView use the custom scroll view

    <com.abc.LDObservableScrollView android:layout_width="fill_parent" android:layout_marginTop="1dip"
            android:id="@+id/OLF_ScrollView" android:layout_height="fill_parent" android:background="@drawable/small_list_back">
            <TableLayout android:layout_width="fill_parent" android:id="@+id/OLF_tableLayout_TableLayout" android:layout_height="fill_parent">
            </TableLayout>
        </com.abc.LDObservableScrollView>
    

    Step-4 In your activity class or where you want to detect the scroll event use the follwoing code

    public class DetectHere implements LDObservableScrollViewListener{
    ...
    
    
    LDObservableScrollView scrollView = (LDObservableScrollView)view.findViewById(R.id.OLF_ScrollView);
             scrollView.setScrollViewListener(this);
    
    .....
    
    @Override
        public void onScrollChanged(LDObservableScrollView scrollView, int x,
                int y, int oldx, int oldy) {
            // TODO Auto-generated method stub
            if((scrollView.getHeight()+y) >= tableLayout.getHeight()){
                Log.e("Custom Listener ", "END OF LIST OCCURRED ::");
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Layout (using TableLayout, etc...) which works well. It seems like this:
I have a TableLayout inside a ScrollView, because of some special needs, I need
Context: I have a TableLayout (created using XML), which has one TableRow, which has
I have a jquery scorlling table which is populated dynamically. I am using Bob
I have created a table (TableLayout) which shows the amount of minutes used calling
I have an android activity in which I'm using tabs. public class UnitActivity extends
I have a TableLayout within a Scrollview. The Table layout defines a form, whose
I'm trying to print the value of the TextViews which are inside TableRows, using
I'm using TableLayout for my swing GUI. Initially only some basic labels, buttons and
I am trying to add TableLayout to the LinearLayout from resourse(xml) using programmable way.

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.