本文整理汇总了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());
}
示例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();
}
示例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) {
}
});
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}