Using static variable in android

Posted by michael on Stack Overflow See other posts from Stack Overflow or by michael
Published on 2010-03-19T08:51:12Z Indexed on 2010/03/19 9:31 UTC
Read the original article Hit count: 182

Filed under:
|
|

Hi,

In android, is it recommend to use static variable? E.g, implement a Singleton pattern in Java, I usually do:

private static A the_instance;
public static A getInstance() {
    if (the_instance == null) {
       the_instance = new A();
    }
    return the_instance;
}

My question is when do that get free by android JVM?

Thank you.

© Stack Overflow or respective owner

Related posts about android

Related posts about java