Skip to content

Instantly share code, notes, and snippets.

@BlueBazze
Created August 30, 2022 09:53
Show Gist options
  • Save BlueBazze/f371f26f21fefdbf1a9251038d727fe1 to your computer and use it in GitHub Desktop.
Save BlueBazze/f371f26f21fefdbf1a9251038d727fe1 to your computer and use it in GitHub Desktop.
private val reactContext: ReactContext
get() = context as ReactContext
// Calling during init of the view
reactContext.addLifecycleEventListener(object : LifecycleEventListener {
override fun onHostResume() {
}
override fun onHostPause() {
}
override fun onHostDestroy() {
reactContext.removeLifecycleEventListener(this)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment