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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:26:20+00:00 2026-06-15T10:26:20+00:00

I simple question but maybe a complex content. For example, I have this classes:

  • 0

I simple question but maybe a complex content. For example, I have this classes:

  • ActivityA.class
  • ActivityB.class
  • ActivityC.class
  • Singleton.class

Singleton is a singleton class pattern, for example:

public class Singleton {
    static Singleton instance = new Singleton();
    private Singleton();

    List<HeavyObject> listaObjects;
}

I use this Singleton in any context (Activity).

My question is: Can Android release this class in any moment without release the current Activity? i.e., I’m watching Activity B, can Android destroy (release) my class Singleton or are the classes only unloaded when all the app is released?

Or maybe when an Activity is destroyed, because the classes are in the context of the Activities?

  • 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-15T10:26:21+00:00Added an answer on June 15, 2026 at 10:26 am

    If there are no outstanding references to Singleton, as in any references are null, the garbage collection mechanism will destroy it once it does its rounds. This means that it will most likely be destroyed but not instantaneously once all references are null.

    However, if even one Activity is using Singleton, it won’t be released unless that Activity is destroyed

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

Sidebar

Related Questions

Maybe this is a simple question but I have this method: public int getMaxColumnData()
Ok so this maybe a simple/silly question but I don't know so here goes:
I have a simple question, but searching on the internet didn't help me (maybe
Okay this may be a simple question but I have yet to come with
may be too simple groovy question but....please help i have a list like this:
Maybe this is a simple question, but I'm trying to change the position of
Maybe this is a very simple question, but I can't find the answer: How
This maybe a simple question, but how do i get all files in a
Maybe the question sound not good or too simple. But not for me in
Maybe my question it's a little weird, but I'm trying to build a not-so-simple

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.