title: How to ignore certain classes from LeakCanary?
body: <p>Can someone give me a working example of how to ignoring certain classes from LeakCanary?</p>
  
  <p>I was looking at this example for ignoring certain classes from third party library in LeakCanary, but I couldn't figure out where to put this in my application. I put this in my Application class, but there are error from these variables and methods: isInAnalyzerProcess, enableDisplayLeakActivity, application, androidWatcher</p>
  
  <pre><code>public class DebugExampleApplication extends ExampleApplication {
    protected RefWatcher installLeakCanary() {
      if (isInAnalyzerProcess(this)) {
        return RefWatcher.DISABLED;
      } else {
        ExcludedRefs excludedRefs = AndroidExcludedRefs.createAppDefaults().build();
        enableDisplayLeakActivity(application);
        ServiceHeapDumpListener heapDumpListener = new ServiceHeapDumpListener(application, DisplayLeakService.class);
        final RefWatcher refWatcher = androidWatcher(application, heapDumpListener, excludedRefs);
        registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
          public void onActivityDestroyed(Activity activity) {
            if (activity instanceof ThirdPartyActivity) {
                return;
            }
            refWatcher.watch(activity);
          }
          // ...
        });
        return refWatcher;
      }
    }
  }
  </code></pre>