leakcanary icon indicating copy to clipboard operation
leakcanary copied to clipboard

Add imports to examples in docs

Open RKhatri93 opened this issue 1 year ago • 3 comments

class DebugExampleApplication : ExampleApplication() {

  override fun onCreate() {
    super.onCreate()
    val analysisUploadListener = EventListener { event ->
      if (event is HeapAnalysisSucceeded) {
        val heapAnalysis = event.heapAnalysis
        TODO("Upload heap analysis to server")
      }
    }

    LeakCanary.config = LeakCanary.config.run {
      copy(eventListeners = eventListeners + analysisUploadListener)
    }
  }
}

where to import the LeakCanary?

RKhatri93 avatar Jan 03 '24 11:01 RKhatri93

import leakcanary.LeakCanary

pyricau avatar Jan 04 '24 07:01 pyricau

Yes' I tried to import it from there and I got an error that 'config' has private access in the leak canary.LeakCanary'. And for the config any other changes needed?

RKhatri93 avatar Jan 04 '24 09:01 RKhatri93

I don't know.

pyricau avatar Jan 09 '24 16:01 pyricau