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

  • Home
  • SEARCH
  • 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 8241049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:42:10+00:00 2026-06-07T20:42:10+00:00

When my activity is being closed, I serialize the application state data to file

  • 0

When my activity is being closed, I serialize the application state data to file to give me a chance to reload the state if the app gets killed by the system.

This approach (saving and restoring state) works fine. But, sometimes, when the process was killed, and depending on the amount of data to load, the loading state process can least some seconds to complete.

So, I can’t load the state on a separeted thread because my activity will crash if the data isn’t there on the onLoad.

So, I’d like to display a progress dialogue while loading the content, but, ensure that the Activity’s onLoad method will be called only after the loading state process.

Does anybody knows how could I achieve this? Thanks a lot.

  • 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-07T20:42:12+00:00Added an answer on June 7, 2026 at 8:42 pm

    Hmmm.. could you Override the onLoad() function, then add a boolean that states whether you’re displaying the dialog or not. If the dialog is being displayed (the boolean is true), don’t let onLoad() do anything; otherwise, carry on as usual. That way once the dialog is dismissed, you can set the boolean to false again, and if onLoad() isn’t called by default afterwards, perhaps you could manually call it? This is just an idea.

    In other words: the dialog can be displayed using an AsyncTask. In the onPreExecute() method, set the boolean to true, do everything you need in doInBackground(), and in onPostExecute(), set the boolean to false and call onLoad().

    On a side note… do you mean onCreate() or onResume()? I’ve actually not heard of onLoad(), unless this is a function you created.

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

Sidebar

Related Questions

So I have a fairly complex activity the parent being a linearlayout with a
For tracking user activity, I am using a Windows Hook for the main application
To track user activity history on a web application, I am attempting to save
I need to be able to handle/catch Intents while my Activity is closed. So
I write a program support download file. When in this download activity, I start
When testing my app using Instruments -> Activity Monitor, I'm seeing a difference in
I have a custom dialog in my app that descends from Activity and uses
In my application onCreate I check some conditions and then I start an Activity
I see all the examples of AlarmManager being set by an Activity. My question
I've successfully being able to use the ACTION_SEND intent which displays my application in

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.