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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:38:10+00:00 2026-06-17T08:38:10+00:00

I have my own Application class object where I store all application data. In

  • 0

I have my own Application class object where I store all application data. In Application.onCreate I create all applications objects and read data from SharedPreferences. My problem is that when the application goes to background it may be killed. After I select the app from launcher, the activity stack is restored (the last Activity is launched, instead of Launcher Activity). The problem is the Application.onCreate is not called thus all applications objects are not loaded and I run into troubles. WHat is the best way to store/restore Application data/object. I know that it can be done in Activities.onCreate/onDestroy but I have many Activities in my app and do not know, which on them will be on top when the application is killed/restarted.

  • 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-17T08:38:11+00:00Added an answer on June 17, 2026 at 8:38 am

    When you launch your application and it starts from the last activity and not from the launcher activity, it means that your application has not been killed. So in this case, your application’s onCreate method will not be called, because it is still alive.

    Application’s onCreate method is called once during the lifecycle of the app. So until your app class is alive, you should have all your application data accessible.

    If you need to test, what happens when your application has been killed, so you should go to the “application manager” and kill manually the app.

    EDIT:
    if your application is alive, as long as your application has a reference to the data, they can not be removed by gc. So, in your case, perhaps you forgot to update the data correctly. So serializing will not help you in this case, otherwise you will have bugs.

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

Sidebar

Related Questions

I have Android application and own Application derived class holding some internal data. Among
I've got an asp.net application where each client will have their own data entry
I have a Winforms application that generates its own PrintDocument object for printing. It
I have an application where for each object the user can specify his own
We have an application where we need to de-serialize some data from one stream
I have an application which takes data from a file and stores it for
I have created my own debugger application. It attaches to a process and creates
I'm writing a web based application that will have its own authorization/authentication mechanism (traditional
I'm currently working on a simple web application where users each have their own
I have an application where users select their own display columns. Each display column

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.