/******************************************/
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
上面三个依赖库要添加到工程(项目的-->build.gradle中的dependencies)的
/**************************************/
在在mainActivity同级目录下新建class继承 Application
public class MyApp extends 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;
}
LeakCanary.install(this);
// Normal app init code...
}
}
在AndroidMainfest.xml文件中需要注册application
在<application
android:name=".MyApp"
......
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
上面三个依赖库要添加到工程(项目的-->build.gradle中的dependencies)的
/**************************************/
在在mainActivity同级目录下新建class继承 Application
public class MyApp extends 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;
}
LeakCanary.install(this);
// Normal app init code...
}
}
在AndroidMainfest.xml文件中需要注册application
在<application
android:name=".MyApp"
......