LeakCanaryApp.kt
TLDR
This file contains the implementation of the LeakCanaryApp
class, an Android application class that extends Application
. It also includes an onCreate
method that registers an ActivityProviderCallbacks
instance as a callback for activity lifecycle events. The LeakCanaryApp
class is annotated with @HiltAndroidApp
, indicating that it should be used as the entry point for Hilt dependency injection.
Classes
LeakCanaryApp
The LeakCanaryApp
class is an Android application class that extends the Application
class. It serves as the entry point for the application and is responsible for initializing various application-level components and managing the application lifecycle. The class is annotated with @HiltAndroidApp
, indicating that it should be used as the entry point for Hilt dependency injection. In the onCreate
method, an instance of ActivityProviderCallbacks
is registered as a callback for activity lifecycle events.
package org.leakcanary
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import org.leakcanary.util.ActivityProviderCallbacks
@HiltAndroidApp
class LeakCanaryApp : Application() {
override fun onCreate() {
super.onCreate()
registerActivityLifecycleCallbacks(ActivityProviderCallbacks())
}
}