Skip to content

Commit

Permalink
use leakcanary
Browse files Browse the repository at this point in the history
  • Loading branch information
onlylemi committed May 14, 2016
1 parent bc7e8fb commit 75b47bb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.android.tools.build:gradle:2.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 2 additions & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ dependencies {
compile project(':library')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
}
1 change: 1 addition & 0 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<application
android:allowBackup="true"
android:name=".DemoApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
Expand Down
30 changes: 30 additions & 0 deletions demo/src/main/java/com/onlylemi/mapview/DemoApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.onlylemi.mapview;

import android.app.Application;
import android.content.Context;

import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;

/**
* DemoApplication
*
* @author: onlylemi
* @time: 2016-05-14 12:07
*/
public class DemoApplication extends Application {

private static Context context;
private RefWatcher refWatcher;

@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
refWatcher = LeakCanary.install(this);
}

public static Context getContext() {
return context;
}
}
3 changes: 1 addition & 2 deletions demo/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
</style>

<style name="AppTheme.Boot" parent="AppTheme">
<!--<item name="android:windowIsTranslucent">true</item>-->
<item name="android:windowBackground">@mipmap/logo</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
</style>

Expand Down

0 comments on commit 75b47bb

Please sign in to comment.