package com.ahau.againstpest.base;

import android.app.Application;
import android.content.Context;

import com.ahau.againstpest.HttpProcessor.AsyncProcessor;
import com.ahau.againstpest.HttpProcessor.HttpHelper;
import com.baidu.mapapi.SDKInitializer;

/**
 * 注释:
 *
 * @author fanchunchun
 * @date 2018/3/31
 */

public class MyApplication extends Application {

    private static Context mContext;

    private static MyApplication instance;
    public static MyApplication getInstance() {
        return instance;
    }
    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;

        mContext = getApplicationContext();

        //在使用SDK各组件之前初始化context信息，传入ApplicationContext
        //注意该方法要再setContentView方法之前实现
        SDKInitializer.initialize(getApplicationContext());


        HttpHelper.init(new AsyncProcessor());
    }

    public static Context getGlobalContext(){
        return mContext;
    }
}
