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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:12:24+00:00 2026-05-16T16:12:24+00:00

I have some data I load into the database the first time a user

  • 0

I have some data I load into the database the first time a user enters my Activity, and want to show a ProgressDialog while this data is loaded for the first time. My Activity is an ExpandableListActivity and I don’t create the SimpleExpandableListAdapter or call setListAdapter passing my adapter until I’m sure the data is actually there. My onCreate looks like this:

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mCategoryDbHelper = new CategoryDBHelper(this);

        // Build default categories... if not there yet
        CategoryDbBuilder builder = new CategoryDbBuilder(this);
        if (!builder.hasCategoriesInTable()) {
            showDialog(PROGRESS_DIALOG_ID);
            builder.fillDbWithDefaultCategories();
            removeDialog(PROGRESS_DIALOG_ID);
        }

        populate();
    }

I’ve overwritten onCreateDialog as such:

@Override
    protected Dialog onCreateDialog(int id) {
        switch (id) {
            case PROGRESS_DIALOG_ID: {
                ProgressDialog dialog = new ProgressDialog(this);
                dialog.setMessage("Loading categories for the first time. Please wait...");
                dialog.setIndeterminate(true);
                dialog.setCancelable(false);
                return dialog;
            }       
        }
        return null;
    }

The populate() method reads the database and sets up my list adapter, then calls setListAdapter.

This seems like it should be simple, but it’s turning out to be a huge pain. Any help would be appreciated. 🙂

  • 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-16T16:12:25+00:00Added an answer on May 16, 2026 at 4:12 pm

    Use AsynTask put your database loading processing in background function and in post execution display result. and there is another function to processing something until background process running here is example of asynTask

    Android – I want to show file upload progress to the user

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

Sidebar

Related Questions

I have an activity that lets the user load some data when they press
I have a data-upload function that load some data into several tables and processes
I have a UINavigationController consisting of a tableview I want to load some data
I have the following code in my application to load some data from my
So I have a uipicker view, that I have managed to load some data
So I'm trying to import some sales data into my MySQL database. The data
I want to load data from several CSV documents in a database. The problem
I have a Form in my application that displays some data. When I first
I have some data loaded as a np.ndarray and need to convert it to
I have some data from log files and would like to group entries by

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.