INNER CODE UNIT · Java
getInstance
getActivity/Toaster · library/src/main/java/com/hjq/toast/ActivityStack.java:19
public static ActivityStack getInstance() {
if(sInstance == null) {
synchronized (ActivityStack.class) {
if (sInstance == null) {
sInstance = new ActivityStack();
}
}
}
return sInstance;
}
/** 私有化构造函数 */
private ActivityStack() {}
/**
* 注册 Activity 生命周期监听
*/
public void register(Application application) {