当前位置: 首页>>代码示例>>Java>>正文


Java LeakCanary类代码示例

本文整理汇总了Java中com.squareup.leakcanary.LeakCanary的典型用法代码示例。如果您正苦于以下问题:Java LeakCanary类的具体用法?Java LeakCanary怎么用?Java LeakCanary使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LeakCanary类属于com.squareup.leakcanary包,在下文中一共展示了LeakCanary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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());
}
 
开发者ID:pabloserranof,项目名称:GuardianReader,代码行数:21,代码来源:MyApplication.java

示例2: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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();
}
 
开发者ID:RobinCaroff,项目名称:MyGeofencer,代码行数:21,代码来源:MyGeofencerApplication.java

示例3: initApplication

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
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) {
            }
        });
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:InitializeService.java

示例4: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:23,代码来源:NavigationApplication.java

示例5: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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();

}
 
开发者ID:z-chu,项目名称:FriendBook,代码行数:22,代码来源:AppContext.java

示例6: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
}
 
开发者ID:Jon6193,项目名称:Android-MVVM,代码行数:24,代码来源:MvvmApplication.java

示例7: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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();
}
 
开发者ID:ezet,项目名称:penguins-in-space,代码行数:20,代码来源:AndroidLauncher.java

示例8: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
}
 
开发者ID:n1rocket,项目名称:eggs-android,代码行数:22,代码来源:MvpApp.java

示例9: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
}
 
开发者ID:komamj,项目名称:KomaMusic,代码行数:21,代码来源:MusicApplication.java

示例10: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
    }
 
开发者ID:l465659833,项目名称:Bigbang,代码行数:20,代码来源:BigBangApp.java

示例11: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
}
 
开发者ID:killnono,项目名称:Dalaran,代码行数:19,代码来源:XApplication.java

示例12: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
}
 
开发者ID:liu-xiao-dong,项目名称:JD-Test,代码行数:18,代码来源:MyApplication.java

示例13: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);

}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:17,代码来源:DouApp.java

示例14: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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);
    }
 
开发者ID:NoEndToLF,项目名称:Gif-Load-ReTry-Refresh,代码行数:20,代码来源:MyApplication.java

示例15: onCreate

import com.squareup.leakcanary.LeakCanary; //导入依赖的package包/类
@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();
    }

}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:19,代码来源:BaseApp.java


注:本文中的com.squareup.leakcanary.LeakCanary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。