@Override public void onCreate() { super.onCreate(); if (BuildConfig.DEBUG) { if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); } component = DaggerAppComponent.builder() .appModule(new AppModule(this)) .netModule(new NetModule()) .repositoryModule(new RepositoryModule()) .build(); Timber.plant(new Timber.DebugTree()); }
@Override public void onCreate() { super.onCreate(); application = this; if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); // Dagger%COMPONENT_NAME% myGeofencerComponent = DaggerMyGeofencerComponent.builder() .contextModule(new ContextModule(this)) .myGeofenceRepositoryModule(new MyGeofenceRepositoryModule()) .geofencingControllerModule(new GeofencingControllerModule()) .build(); }
private void initApplication() { //初始化日志 Logger.init(getPackageName()).hideThreadInfo(); //初始化错误收集 // CrashHandler.init(new CrashHandler(getApplicationContext())); initBugly(); //初始化内存泄漏检测 LeakCanary.install(App.getInstance()); //初始化过度绘制检测 BlockCanary.install(getApplicationContext(), new AppBlockCanaryContext()).start(); //初始化tbs x5 webview QbSdk.allowThirdPartyAppDownload(true); QbSdk.initX5Environment(getApplicationContext(), QbSdk.WebviewInitType.FIRSTUSE_AND_PRELOAD, new QbSdk.PreInitCallback() { @Override public void onCoreInitFinished() { } @Override public void onViewInitFinished(boolean b) { } }); }
@Override public void onCreate() { super.onCreate(); // Leak canary if (LeakCanary.isInAnalyzerProcess(this)) { return; } LeakCanary.install(this); if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); } // Set access token String mapboxAccessToken = Utils.getMapboxAccessToken(getApplicationContext()); if (TextUtils.isEmpty(mapboxAccessToken) || mapboxAccessToken.equals(DEFAULT_MAPBOX_ACCESS_TOKEN)) { Log.w(LOG_TAG, "Warning: access token isn't set."); } Mapbox.getInstance(getApplicationContext(), mapboxAccessToken); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } //初始化全局异常捕获 Thread.setDefaultUncaughtExceptionHandler(new AppException(this)); //初始化内存泄漏检测器 LeakCanary.install(this); //初始化日志打印器 Logger.init("FriendBook"); //初始化AppManager AppManager.init(this); DBRepository.initDatabase(this); initUmeng(this); initTheme(); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); Stetho.initializeWithDefaults(this); if(BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); Timber.plant(new StethoTree()); } component = DaggerApplicationComponent.builder() .applicationModule(new ApplicationModule(this)) .build(); component.inject(this); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this.getApplication()); playService = new AndroidNetworkService(this); no.ntnu.tdt4240.asteroids.service.ISettingsService settingsService = new AndroidSettingsService(this.getApplicationContext()); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); config.useCompass = false; config.useAccelerometer = false; config.useImmersiveMode = true; config.useWakelock = true; initialize(new Asteroids(playService, settingsService), config); playService.setup(); }
@Override public void onCreate() { super.onCreate(); createAppComponent(); DaggerAndroidInjector.initialize(this); AppLogger.init(); if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); Stetho.initializeWithDefaults(this); } if (!LeakCanary.isInAnalyzerProcess(this)) { LeakCanary.install(this); } CalligraphyConfig.initDefault(mCalligraphyConfig); }
@Override public void onCreate() { super.onCreate(); LogUtils.i(TAG, "onCreate"); enableStrictMode(); sContext = getApplicationContext(); ImageLoaderConfiguration localImageLoaderConfiguration = new ImageLoaderConfiguration.Builder(this).build(); ImageLoader.getInstance().init(localImageLoaderConfiguration); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); instance = this; Global.init(this); LeakCanary.install(this); // CrashHandler.getInstance().init(this); Looper.myQueue().addIdleHandler(new MessageQueue.IdleHandler() { @Override public boolean queueIdle() { KeepAliveWatcher.keepAlive(BigBangApp.this); startService(new Intent(BigBangApp.this, ListenClipboardService.class)); startService(new Intent(BigBangApp.this, BigBangMonitorService.class)); return false; } }); AppManager.getInstance(this); }
@Override public void onCreate() { super.onCreate(); mContext = this; // The Realm file will be located in Context.getFilesDir() with name "default.realm" Realm.init(this); RealmConfiguration config = new RealmConfiguration.Builder() .deleteRealmIfMigrationNeeded() .build(); Realm.setDefaultConfiguration(config); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } if(CommonConfig.DEBUG){ LeakCanary.install(this); ARouter.openLog(); // 打印日志 ARouter.openDebug(); // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险) } ARouter.init(this); //CrashReport.initCrashReport(getApplicationContext(), "93f0e37549", CommonConfig.DEBUG); Fresco.initialize(this); GlobalAppComponent.init(this); }
@Override public void onCreate() { super.onCreate(); Fresco.initialize(this);//Init Fresco applicationComponent = DaggerApplicationComponent.builder() .applicationModule(new ApplicationModule(this)) .contextModule(new ContextModule(this)) .databaseModule(new DatabaseModule()) .networkModule(new NetworkModule()) .build(); applicationComponent.inject(this); CalligraphyConfig.initDefault(calligraphyConfig); Timber.plant(new Timber.DebugTree()); LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); LeakCanary.install(this); LoadRetryRefreshConfig config=new LoadRetryRefreshConfig(); config.setBackgroundColor(R.color.white); config.setBtnNormalColor(R.color.blue_normal); config.setBtnPressedColor(R.color.blue_press); // config.setBtnBorderColor(R.color.oringe_normal); config.setBtnRadius(10f); config.setBtnText("点击重新加载"); config.setLoadText("加载中 , 请稍候 ..."); config.setBtnTextColor(R.color.white); config.setLoadAndErrorTextColor(R.color.gray); config.setGif(R.drawable.test); config.setStartAnimTime(100); config.setEndAnimTime(500); LoadReTryRefreshManager.getInstance().setLoadRetryRefreshConfig(config); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { mRefWatcher = RefWatcher.DISABLED; } else { mRefWatcher = LeakCanary.install(this); } if (isInMainProcess()) { instance = this; Thread.setDefaultUncaughtExceptionHandler(new AppCrashHandler(this)); initModule(); } }
@Override public void onCreate() { super.onCreate(); initializeDependencies(); if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); Stetho.initializeWithDefaults(this); } if (LeakCanary.isInAnalyzerProcess(this)) { return; } LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this) || ProcessPhoenix.isPhoenixProcess(this)) { return; } LeakCanary.install(this); AndroidThreeTen.init(this); component = DaggerInitializer.init(this); component.inject(this); appInitializer.init(this); lumberYard.cleanUp(); Timber.plant(lumberYard.tree()); registerActivityLifecycleCallbacks(activityHierarchyServer); }
@Override public void onCreate() { super.onCreate(); if (!LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. You should not init your app in this process. installLeakCanary(); } }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); // Normal app init code... }
/** * 初始化配置 */ private void _initConfig() { mRefWatcher = LeakCanary.install(this); Logger.init("LogTAG"); //初始化网络配置 RetrofitService.init(); }
/** * 初始化配置 */ private void _initConfig() { if (BuildConfig.DEBUG) { LeakCanary.install(getApplication()); Logger.init("LogTAG"); } RetrofitService.init(); ToastUtils.init(getApplication()); DownloaderWrapper.init(mRxBus, mDaoSession.getVideoInfoDao()); FileDownloader.init(getApplication()); DownloadConfig config = new DownloadConfig.Builder() .setDownloadDir(PreferencesUtils.getSavePath(getApplication()) + File.separator + "video/").build(); FileDownloader.setConfig(config); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } refWatcher = LeakCanary.install(this); Timber.d("Starting Application"); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } refWatcher = LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } mailComponent = DaggerMailAppComponent.create(); refWatcher = LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); refWatcher = LeakCanary.install(this); sInstance = this; initCompoent(); AppUtils.init(this); CrashHandler.getInstance().init(this); initPrefs(); initNightMode(); //initHciCloud(); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } enabledStrictMode(); LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); }
private void installLeakCanary() { if (BuildConfig.DEBUG) { if (LeakCanary.isInAnalyzerProcess(this)) { return; } LeakCanary.install(this); } }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } LeakCanary.install(this); CrashHandler.getInstance().init(this); Diycode.init(this, client_id, client_secret); Config.init(this); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } LeakCanary.install(this); }
@Override public void onCreate() { super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); DaggerAppComponent.builder().app(this).build().inject(this); }
@Override public void onCreate() { setStrictMode(); super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); // Normal app init code... }
@Override public void onCreate() { super.onCreate(); Realm.init(this); RealmConfiguration config = new RealmConfiguration.Builder().deleteRealmIfMigrationNeeded().build(); Realm.setDefaultConfiguration(config); if (LeakCanary.isInAnalyzerProcess(this)) { // This process is dedicated to LeakCanary for heap analysis. // You should not init your app in this process. return; } LeakCanary.install(this); app = this; if(BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); Stetho.initialize( Stetho.newInitializerBuilder(this) .enableDumpapp(Stetho.defaultDumperPluginsProvider(this)) .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build()) .build()); } Timber.i("Creating Application"); }