I have a singleton that I'd like to keep alive for the lifetime of an Application
.
public final class KeepAlive extends Whatever {
private KeepAlive() {}
private static class Singleton {
private static final KeepAlive instance = new KeepAlive();
}
}
Is Singleton.instance
considered a strong reference, so that it will not get GC'ed?
UPDATE: Does Android use a custom classloader? Is so, would it ever unload a class like KeepAlive
or Singleton
?