1. 程式人生 > >封裝好的單例模式

封裝好的單例模式

public class MyApp extends Application {
    public static MyApp mInstance;
    @Override
public void onCreate() {
        super.onCreate();
        mInstance = this;
        Fresco.initialize(this);
    }

    public static MyApp getInstance() {
        return mInstance;
    }
}