Created
December 2, 2020 15:23
-
-
Save BuiVanNam/74f97bd9ca0dd78536fc0e40e1ebc8d3 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
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