LeakCanary is a memory leak detection library for Android and Java. LeakCanary
My project is based on android make file system, which relies on some android internal
This is needed to be part of your application in order for leakcanary to work.
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
LeakCanary.install(this);
}
}
but this is confusing because most of us do not write such kind of class that extends the Application class directly, a work around rather a simple statement will fix this problem,
public class YourClass extends Activity{//AppCompatActivity, A ctionBarActivity or anything
@Override public void onCreate() {
super.onCreate();
LeakCanary.install(getApplication());
}
}
hope this helps!!!
Its better to call this method in
onPostCreate()