-Added LeakCanary to debug build for memory detection on activities and fragments.
-Added LeakCanary no-op lib to release and beta builds.
This commit is contained in:
parent
e88312659b
commit
622d698ff8
4 changed files with 41 additions and 0 deletions
|
|
@ -4,6 +4,10 @@ import android.content.Context;
|
|||
import android.support.multidex.MultiDex;
|
||||
|
||||
import com.facebook.stetho.Stetho;
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
import com.squareup.leakcanary.RefWatcher;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class DebugApp extends App {
|
||||
private static final String TAG = DebugApp.class.toString();
|
||||
|
|
@ -41,4 +45,11 @@ public class DebugApp extends App {
|
|||
// Initialize Stetho with the Initializer
|
||||
Stetho.initialize(initializer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RefWatcher installLeakCanary() {
|
||||
return LeakCanary.refWatcher(this)
|
||||
.watchDelay(5, TimeUnit.SECONDS)
|
||||
.buildAndInstall();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue