Skip to content

Instantly share code, notes, and snippets.

@Magdi
Created March 10, 2017 18:12
Show Gist options
  • Save Magdi/df718289f576a50fd7e5ecbce5aff58e to your computer and use it in GitHub Desktop.
Save Magdi/df718289f576a50fd7e5ecbce5aff58e to your computer and use it in GitHub Desktop.
leakcanary Application class
public class ExampleApplication 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...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment