Created
October 14, 2021 21:54
-
-
Save graffiti75/eca8d71fd498d09240e842ef438490d6 to your computer and use it in GitHub Desktop.
[ Medium ] Activity Lifecycle in Android
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() { | |
private val TAG = "MainActivity" | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
} | |
override fun onStart() { | |
super.onStart() | |
Log.i(TAG, "onStart") | |
} | |
override fun onResume() { | |
super.onResume() | |
Log.i(TAG, "onResume") | |
} | |
override fun onPause() { | |
super.onPause() | |
Log.i(TAG, "onPause") | |
} | |
override fun onStop() { | |
super.onStop() | |
Log.i(TAG, "onStop") | |
} | |
override fun onRestart() { | |
super.onRestart() | |
Log.i(TAG, "onRestart") | |
} | |
override fun onDestroy() { | |
super.onDestroy() | |
Log.i(TAG, "onDestroy") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment