1
我有一个单身我想在Application
的整个生命周期中保持活力。是Android静态参考强
public final class KeepAlive extends Whatever {
private KeepAlive() {}
private static class Singleton {
private static final KeepAlive instance = new KeepAlive();
}
}
是Singleton.instance
认为是一个有力的参考,所以它不会得到GC'ed?
更新: Android是否使用自定义类加载器?是的,它会不会卸载类似KeepAlive
或Singleton
?