Skip to content

Instantly share code, notes, and snippets.

@nosix
Created July 28, 2016 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nosix/20dbef6b7afd2bb5fdc8a6b241b90b2c to your computer and use it in GitHub Desktop.
Save nosix/20dbef6b7afd2bb5fdc8a6b241b90b2c to your computer and use it in GitHub Desktop.
Using the LeakCanary that is a memory leak detection library for Android and Java.
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="xxx">
<application
android:name=".MyApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
...
</application>
</manifest>
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
}
package xxx
import android.app.Application
import com.squareup.leakcanary.LeakCanary
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
LeakCanary.install(this)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment