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

Feature Request: Programmatic API to launch LeakActivity #1337

Closed
ZacSweers opened this issue May 7, 2019 · 5 comments · Fixed by #1341
Closed

Feature Request: Programmatic API to launch LeakActivity #1337

ZacSweers opened this issue May 7, 2019 · 5 comments · Fixed by #1341
Milestone

Comments

@ZacSweers
Copy link
Contributor

This is something I think would be useful for debug builds (especially for companies with multiple apps) to allow for launching the leak activity directly (via button in a debug drawer or something similar)

Something like this:

LeakCanary.startLeakActivity(context)
@emartynov
Copy link

Would it be also useful to have API to start leak detection/analysis? Since we have a threshold to launch analysis I tend to tap back and force to trigger it while checking if I fixed it or not.

@pyricau
Copy link
Member

pyricau commented May 7, 2019

@emartynov can you file a separate issue?

@ZacSweers I'm hesitating between starting the activity and producing an intent that will. The later is more flexible but requires a context and more code, the former is straightforward but couldn't be used for say pending intents or adding shortcuts etc.

@pyricau
Copy link
Member

pyricau commented May 7, 2019

Also worth noting LeakCanary 2 adds a dynamic shortcut on the main app launcher

@ZacSweers
Copy link
Contributor Author

ZacSweers commented May 7, 2019 via email

@pyricau
Copy link
Member

pyricau commented May 7, 2019

LeakCanary.leakDisplayActivityIntent (val) ?

pyricau pushed a commit that referenced this issue May 8, 2019
Resolves #1337

Kept it as a function rather than a val since the best we could do due to the context requirement would be an awkward `lateinit var`.
@pyricau pyricau added this to the 2.0 Next Release milestone May 21, 2019
@pyricau pyricau modified the milestones: 2.0-alpha-3, 2.0-alpha-2 Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants