Challenge 1: Logging Every Lifecycle Callback — Solution class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) Log.d("MainActivity", "onCreate called") } override fun onStart() { super.onStart() Log.d("MainActivity", "onStart called") } override fun onResume() { super.onResume() Log.d("MainActivity", "onResume called") } override fun onPause() { super.onPause() Log.d("MainActivity", "onPause called") } override fun onStop() { super.onStop() Log.d("MainActivity", "onStop called") } override fun onDestroy() { super.onDestroy() Log.d("MainActivity", "onDestroy called") } } Walkthrough: 1. Add all six overrides above to MainActivity.kt, run the app. 2. On first launch, Logcat shows: onCreate, onStart, onResume — in that order. 3. Rotate the emulator (Ctrl+F11 on Windows/Linux, or the rotate icon in the emulator's side toolbar). 4. Logcat then shows: onPause, onStop, onDestroy, onCreate, onStart, onResume — the entire Activity was destroyed and recreated from scratch by the rotation. Notes: - The rotation behavior (full destroy + recreate) is the default and is exactly why savedInstanceState (Challenge 2) matters — without it, any var holding UI state (a counter, typed text, a scroll position) resets to its initial value after every rotation. - Pressing Home (not rotating) instead produces onPause, onStop only — the Activity is stopped but NOT destroyed, since it might be resumed later without needing to be recreated.