The Lifecycle
Android vs Java
If you use Android Studio on the lab machines: Update Java JDK Location
HW 1 Recap
Running a Java Program
Compiling and Running Java Programs
What is “main” all about?
$ man java
Where is main in our MainActivity.java?
The Android Lifecycle
Android Runs and Drives our Code
android.app.Activity
Generally speaking, an Activity can be thought of as a single screen of an app.
Activity Lifecycle
Activity Lifecycle States
Things that affect the Lifecycle
Other Lifecycles. Common Paradigm
Deep Dive on Lifecycle
onCreate(Bundle bundle)
onStart()
onResume()
onPause()
onStop()
onDestroy()
Saving Instance State
Saving State in Lifecycle
android.os.Bundle
onSaveInstanceState(Bundle outState)
Lifecycle in Action: log statements
($ git checkout lifecycle-logs)
Now that we understand the lifecycle, how we you use it?
How do we tell Android to start an Activity for us?
Creating an Activity
android.content.Intent
Creating an Intent
Programmatic Intents ($ git checkout intent-basics)
Intents are handled by the system
Specifying an Initial Activity
AndroidManifest.xml
Questions?
HW 2: Build public Android repo