Backlight87
8/24/2017 - 7:02 PM

全局的Application,通常用来获取唯一的application或者是进行全局的配置

全局的Application,通常用来获取唯一的application或者是进行全局的配置

public class MyApplication extends Application {

    private static MyApplication instance;
    
    public static MyApplication getApplication() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
    }
   
}