Java 类com.squareup.leakcanary.LeakCanary 实例源码

项目:GuardianReader    文件:MyApplication.java   
@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());
}
项目:MyGeofencer    文件:MyGeofencerApplication.java   
@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();
}
项目:GitHub    文件:InitializeService.java   
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) {
            }
        });
    }
项目:mapbox-navigation-android    文件:NavigationApplication.java   
@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);
}
项目:FriendBook    文件:AppContext.java   
@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();

}
项目:Android-MVVM    文件:MvvmApplication.java   
@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);
}
项目:penguins-in-space    文件:AndroidLauncher.java   
@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();
}
项目:eggs-android    文件:MvpApp.java   
@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);
}
项目:KomaMusic    文件:MusicApplication.java   
@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);
}
项目:Bigbang    文件:BigBangApp.java   
@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);
    }
项目:Dalaran    文件:XApplication.java   
@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);
}
项目:JD-Test    文件:MyApplication.java   
@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);
}
项目:JD-Test    文件:TestModuleApplication.java   
@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);
}
项目:DOUSalaries    文件:DouApp.java   
@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);

}
项目:Gif-Load-ReTry-Refresh    文件:MyApplication.java   
@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);
    }
项目:FastAndroid    文件:BaseApp.java   
@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();
    }

}
项目:mvp-android-arch-component    文件:AndroidApplication.java   
@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);
}
项目:superglue    文件:SuperGlueApp.java   
@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);
}
项目:RIBs    文件:SampleApplication.java   
@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();
  }
}
项目:GitHub    文件:MainApplication.java   
@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...
}
项目:GitHub    文件:App.java   
/**
 * 初始化配置
 */
private void _initConfig() {
    mRefWatcher = LeakCanary.install(this);
    Logger.init("LogTAG");
    //初始化网络配置
    RetrofitService.init();
}
项目:GitHub    文件:AndroidApplication.java   
/**
 * 初始化配置
 */
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);
}
项目:GitHub    文件:SampleApplication.java   
@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");
}
项目:GitHub    文件:SampleApplication.java   
@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);
}
项目:GitHub    文件:MailApplication.java   
@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);
}
项目:GitHub    文件:ReaderApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    refWatcher = LeakCanary.install(this);
    sInstance = this;
    initCompoent();
    AppUtils.init(this);
    CrashHandler.getInstance().init(this);
    initPrefs();
    initNightMode();
    //initHciCloud();
}
项目:FrameAnimationView    文件:MyApplication.java   
@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...
}
项目:GitHub    文件:TkApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    if (LeakCanary.isInAnalyzerProcess(this)) {
        return;
    }
    enabledStrictMode();
    LeakCanary.install(this);
}
项目:GitHub    文件:App.java   
@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);
}
项目:GitHub    文件:App.java   
@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);
}
项目:Boilerplate    文件:TlApplication.java   
private void installLeakCanary() {
    if (BuildConfig.DEBUG) {
        if (LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);
    }
}
项目:GitHub    文件:SampleApplication.java   
@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");
}
项目:GitHub    文件:SampleApplication.java   
@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);
}
项目:GitHub    文件:MailApplication.java   
@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);
}
项目:diycode    文件:BaseApplication.java   
@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);
}
项目:EmotionApp    文件:MyApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    if (LeakCanary.isInAnalyzerProcess(this)) {
        return;
    }
    LeakCanary.install(this);
}
项目:udacity-baking-app-mvvm-rxjava-dagger    文件:App.java   
@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);
}
项目:EspressoMockitoDaggerLeakCanary    文件:EmdlcApplication.java   
@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);
}
项目:AndroidAsyncHTTP    文件:SampleApplication.java   
@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...
}
项目:MovieApp    文件:MovieApp.java   
@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");
}