Last active
February 20, 2022 18:01
-
-
Save thecodeside/6b288a8546ddc9d4b52a077e65d6f209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Graph { | |
private lateinit var appContext: Application | |
// lazily initialized singleton scope | |
val fancyManager by lazy { FancyManager(appContext) } | |
fun init(appContext: Application) { | |
this.appContext = appContext | |
} | |
} | |
// Initialization of the Graph in the Application class: | |
class FancyApp : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
Graph.init(this) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment