123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package com.example.myapplication;
- import android.app.Application;
- import com.facebook.stetho.Stetho;
- public class MyApplication extends Application {
- /**
- * 点击home的时间(home后台,大于5分钟。显示手势)
- */
- // public static long sHomeInBackTime;
- public static boolean sIsAppOnForeground;
- /**
- * 全局Application唯一实例
- */
- private static MyApplication sInstance;
- @Override
- public void onCreate() {
- super.onCreate();
- //do something to the debug mode.
- sInstance = this;
- if (BuildConfig.DEBUG) {
- Stetho.initializeWithDefaults(this);
- }
- // FIR.init(this);
- // GrowingIO.startWithConfiguration(this, new Configuration()
- // .useID()
- // .trackAllFragments()
- // .setChannel(ManifestUtils.getChannelNameFromManifest(this)));
- // if (BuildConfig.DEBUG) {
- // CrashHandler.install(this);
- // }
- //
- // BugtagsOptions options = new BugtagsOptions.Builder().
- // trackingLocation(true).//是否获取位置
- // trackingCrashLog(true).//是否收集crash
- // trackingConsoleLog(true).//是否收集console log
- // trackingUserSteps(true).//是否收集用户操作步骤
- // versionName(PhoneUtil.getVersion(sInstance)).//自定义版本名称
- // versionCode(PhoneUtil.getVersionCode(sInstance)).//自定义版本号
- // build();
- // Bugtags.start("0d99abd8ad606e09d208e008d57e8eb7", this, Bugtags.BTGInvocationEventBubble, options);
- }
- /**
- * 获取一个Application的实例
- */
- public static MyApplication getInstance() {
- return sInstance;
- }
- }
|