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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:58:23+00:00 2026-05-23T12:58:23+00:00

I have a table with about 1k rows that I want to display. This

  • 0

I have a table with about 1k rows that I want to display. This task obviously chokes the UI thread, resulting in a black screen while the onCreate() builds the table.

I’ve solved this by using AsyncTask which builds the wanted TableLayout in the “doInBackground” function and display it on the “onPostExecute” function.

Question #1:
Is there any better practice that I’m not familiar with?

Question #2:
My (simplified) “doInBackground” function looks like this:

protected Void doInBackground(Void... v) {

        tmpTableLayout = populateTable("");
        return null;
    }

And my (simplified) “onPostExecute” function looks like this:

protected void onPostExecute(Void v) {

        TableLayout ct = (TableLayout)findViewById(R.id.RealTable);
        ct.removeAllViews();
        /* WHATS HERE? */
    }

What should I write instead of the “WHATS HERE?” in the last line of code in order to display the content of “tmpTableLayout” in “ct” ?

Thanks in advance!

  • 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-23T12:58:23+00:00Added an answer on May 23, 2026 at 12:58 pm

    Are you sure you want to display it all in one go?

    One approach would be to dynamically load in more lines as the user scrolls down. So have a scroll listener that checks if the user is approaching the end of the content that is displayed and therefore start an AsyncTask or a thread loading more content.

    Example:
    Android List Activity with dynamically loaded images form the web in android

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

Sidebar

Related Questions

I have a MySQL table with about 5,000,000 rows that are being constantly updated
I have a table of data that contains about 260 rows. Each of these
I have a table with about 10K rows, which I am trying to alter
I have a table of about a million rows and I need to update
I have a table with about 5,000 rows which I build dynamically with jQyuery.
I have currently in a table about 90k rows. And it's will grow up
i have a table with about 200,000 records. i want to add a field
I have a table with about 100k records and I want to delete some
I have a table that has about 1/2 million records in it. Each month
I have a table that has two columns, ID and Value. For this example

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.