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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:25:42+00:00 2026-06-02T03:25:42+00:00

I’m facing a similar issue like this one . I’m using some static class

  • 0

I’m facing a similar issue like this one. I’m using some static class members inlcuding singletons in my aplication. When I leave the main activity using finish() and start it again, all static members are still present. It seems not to be a good soloution to call Process.killProcess(Process.myPid()); and I also don’t want to need to unset all static members when I leave the application because this is error-prone when extending the application. So how would one completely quit an android application properly?

  • 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-02T03:25:43+00:00Added an answer on June 2, 2026 at 3:25 am

    Just some important observations on this topic (as I think):

    This is an important aspect of Android programming. Checking the activity lifecycle documentations here http://developer.android.com/reference/android/app/Activity.html does not really do justice on explaining this behaviour well – as I think.

    There is the underlying class-loader concept, which loads the class incl all your initial settings of static variables. Once the activity stops and even gets destroyed it may still remain in memory!

    When you now start the app again, the last state of the class will be taken – if it still can be found in memory. It is NOT the case that the class will be initialized like the very first time when the class loader loads and initialized your class.

    This is also the reason why during development/debugging restarting the app really “cleans” the complete class before starting while afterwards when the app is installed and started/quit on the device you may not force a “real” start like during debugging.

    Nullifying variables just increases the probability for GC. You may not force an unload afaik. So there is no way to “completely quit an app” in that sense.

    One has to design the app – esp the more complex ones – around this system behaviour.

    This is my understanding so far – unfortunately I have not found any good thorough documentation on this.

    If I should be wrong – please forgive and correct!

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string

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.