package com.stu.assistant.base;

import android.app.Application;

import com.stu.assistant.BuildConfig;
import com.stu.assistant.net.OkGoConfig;
import com.stu.assistant.uitls.CrashHandler;
import com.stu.assistant.uitls.CrashHandlerManage;
import com.stu.assistant.uitls.ShowClassNameCallBack;
import com.tencent.bugly.crashreport.CrashReport;

import cn.bmob.v3.Bmob;

public class BaseApplion extends Application {
    public static BaseApplion application;
    public static ActivityManage activityManage;

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

        OkGoConfig.initOkGo(this);
        if (BuildConfig.DEBUG) {
            registerActivityLifecycleCallbacks(new ShowClassNameCallBack());
            CrashHandlerManage.getInstance()
                    .init(getApplicationContext());
            CrashHandler.getInstance().setDelayTime(1000 * 60 * 1).init(getApplicationContext());
        }
        CrashReport.initCrashReport(getApplicationContext(), "6e238eccba", false);

        Bmob.initialize(this, "76a343b680dc028081fb0dd8b028a08d");
    }

    public static ActivityManage getActivityManage() {
        if (activityManage == null) {
            activityManage = new ActivityManage();
        }
        return activityManage;
    }
}
