Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add imports to examples in docs #2610

Open
RKhatri93 opened this issue Jan 3, 2024 · 3 comments
Open

Add imports to examples in docs #2610

RKhatri93 opened this issue Jan 3, 2024 · 3 comments

Comments

@RKhatri93
Copy link

RKhatri93 commented Jan 3, 2024

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?

@pyricau
Copy link
Member

pyricau commented Jan 4, 2024

import leakcanary.LeakCanary

@pyricau pyricau changed the title Doc issue with uploading/ page Add imports to examples in docs Jan 4, 2024
@RKhatri93
Copy link
Author

RKhatri93 commented Jan 4, 2024

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?

@pyricau
Copy link
Member

pyricau commented Jan 9, 2024

I don't know.

mhansen added a commit to mhansen/leakcanary that referenced this issue May 8, 2024
Include import statements and fix a few APIs that had drifted, and an invalid
variable name.

I've tested this locally against LeakCanary v2.14 and it compiles now.

Towards square#2610
mhansen added a commit to mhansen/leakcanary that referenced this issue May 8, 2024
Include import statements and fix a few APIs that had drifted, and an invalid
variable name.

I've tested this locally against LeakCanary v2.14 and it compiles now.

Towards square#2610
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants