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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:05:16+00:00 2026-05-18T05:05:16+00:00

I have a realtively complicated listview in my application, with data fetched from the

  • 0

I have a realtively complicated listview in my application, with data fetched from the internet and so on. What is the best practice to do to preload as much as possible of the ListView, such that it appears immediately on the screen?

For example, the standard SMS/MMS app of android shows a white screen with a spinning loader and “Loading…” before a conversation is shown. I can’t really find this in the Android source code, but I guess this is an extra loading Activity doing some caching and handing over to the conversation Activity using finish(), so that no screen change animation is shown.

How can I preload or cache ListView items? Is it even possible to do that?

Thanks! Best regards, Jan Oliver

  • 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-18T05:05:16+00:00Added an answer on May 18, 2026 at 5:05 am

    That’s done with the help of AsyncTask (an intelligent backround thread) and ProgressDialog

    When the AsyncTask starts we raise a progressdialog with indeterminate state, once the task is finished we dismiss the dialog.

    Example code
    What the adapter does in this example is not important, more important to understand that you need to use AsyncTask to display a dialog for the progress.

    private class PrepareAdapter1 extends AsyncTask<Void,Void,ContactsListCursorAdapter > {
        ProgressDialog dialog;
        @Override
        protected void onPreExecute() {
            dialog = new ProgressDialog(viewContacts.this);
            dialog.setMessage(getString(R.string.please_wait_while_loading));
            dialog.setIndeterminate(true);
            dialog.setCancelable(false);
            dialog.show();
        }
        /* (non-Javadoc)
         * @see android.os.AsyncTask#doInBackground(Params[])
         */
        @Override
        protected ContactsListCursorAdapter doInBackground(Void... params) {
            cur1 = objItem.getContacts();
            startManagingCursor(cur1);
    
            adapter1 = new ContactsListCursorAdapter (viewContacts.this,
                    R.layout.contact_for_listitem, cur1, new String[] {}, new int[] {});
    
            return adapter1;
        }
    
        protected void onPostExecute(ContactsListCursorAdapter result) {
            list.setAdapter(result);
            dialog.dismiss();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a relatively complicated generic type (say Map<Long,Map<Integer,String>> ) which I use internally
We are adapting our client side relatively complicated application (ActiveX / .net / Delphi
I have a somewhat complicated assortment of tables for which I need to do
Background : I currently have a Web Forms, ASP.NET 3.5/C# application which I'm interested
I have a relatively large csv/text data file (33mb) that I need to do
We have a relatively large web application (>200 pages) to which we need to
I have a relatively simple site that I'm working up for an intranet environment.
We have are relatively simple Reporting Services report that our users commonly export to
I have a relatively complex .htaccess file to control page requests, this currently redirects
I have a relatively simple form which asks a variety of questions. One of

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.