🤔 Documentation issue? Report it

leakcanary-object-watcher-android / leakcanary / AppWatcher

AppWatcher

object AppWatcher

The entry point API for using ObjectWatcher in an Android app. AppWatcher.objectWatcher is in charge of detecting retained objects, and AppWatcher is auto configured on app start to pass it activity and fragment instances. Call ObjectWatcher.watch on objectWatcher to watch any other object that you expect to be unreachable.

Types

Name Summary
Config data class Config
AppWatcher configuration data class. Properties can be updated via copy.

Properties

Name Summary
config var config:AppWatcher.Config
The current AppWatcher configuration. Can be updated at any time, usually by replacing it with a mutated copy, e.g.:
isInstalled val isInstalled:Boolean
objectWatcher val objectWatcher: ObjectWatcher
The ObjectWatcher used by AppWatcher to detect retained objects.

Functions

Name Summary
manualInstall fun manualInstall(application: Application):Unit
AppWatcher is automatically installed on main process start by leakcanary.internal.AppWatcherInstaller which is registered in the AndroidManifest.xml of your app. If you disabled leakcanary.internal.AppWatcherInstaller or you need AppWatcher or LeakCanary to run outside of the main process then you can call this method to install AppWatcher.