Skip to content

Instantly share code, notes, and snippets.

@BuiVanNam
Created December 2, 2020 15:23
Show Gist options
  • Save BuiVanNam/74f97bd9ca0dd78536fc0e40e1ebc8d3 to your computer and use it in GitHub Desktop.
Save BuiVanNam/74f97bd9ca0dd78536fc0e40e1ebc8d3 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
lateinit var instanceA : ClassA
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
instanceA = ClassA()
}
override fun onResume() {
super.onResume()
instanceA.registerListenerAChange()
}
override fun onStop() {
super.onStop()
instanceA.unRegisterListenerAChange()
}
override fun onDestroy() {
super.onDestroy()
instanceA.releaseAll()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment