File tree 3 files changed +13
-0
lines changed
src/main/java/de/jonasrottmann/realmsample
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ dependencies {
44
44
compile " com.android.support:appcompat-v7:$project . supportLibVersion "
45
45
compile " com.jakewharton.timber:timber:$project . timberVersion "
46
46
47
+ debugCompile " com.squareup.leakcanary:leakcanary-android:$project . leakCanaryVersion "
48
+ releaseCompile " com.squareup.leakcanary:leakcanary-android-no-op:$project . leakCanaryVersion "
49
+ testCompile " com.squareup.leakcanary:leakcanary-android-no-op:$project . leakCanaryVersion "
50
+
47
51
androidTestCompile ' com.android.support.test.espresso:espresso-core:2.2.2' , {
48
52
exclude group : ' com.android.support' , module : ' support-annotations'
49
53
}
Original file line number Diff line number Diff line change 1
1
package de .jonasrottmann .realmsample ;
2
2
3
+ import com .squareup .leakcanary .LeakCanary ;
4
+
3
5
import de .jonasrottmann .realmbrowser .RealmBrowser ;
4
6
import io .realm .Realm ;
5
7
import io .realm .RealmConfiguration ;
@@ -12,6 +14,12 @@ public class Application extends android.app.Application {
12
14
@ Override
13
15
public void onCreate () {
14
16
super .onCreate ();
17
+
18
+ if (LeakCanary .isInAnalyzerProcess (this )) {
19
+ return ;
20
+ }
21
+ LeakCanary .install (this );
22
+
15
23
Timber .plant (new Timber .DebugTree ());
16
24
17
25
Realm .init (this );
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ buildscript {
17
17
// dependencies
18
18
timberVersion = ' 4.5.1'
19
19
supportLibVersion = ' 25.3.1'
20
+ leakCanaryVersion = ' 1.5.1'
20
21
}
21
22
22
23
repositories {
You can’t perform that action at this time.
0 commit comments