MODULE 4 Flashcards
Lifecycle:
The way Android apps interact with Android OS
_____ help with knowing where to put java code depending on the objective
Phases of the lifecycle
Android applications start with _____
a series of callback methods
Activity:
A screen of an app’s interface
_____ decides how an app is viewed by a user
Current phase
Android lifecycle phases:
- Being created
- Starting
- Resuming
- Running
- Pausing
- Stopping
- Being destroyed
onResume:
Reloads saved data from when the app was interrupted
onCreate:
Declares the UI to setContentView, graphics, and sound
onStart:
Makes the activity visible and initializes the code that maintains the UI
onPause:
Saves data when device goes to sleep or user about to switch to another app
onStop:
Releases resources when another app is started
onDestroy:
Removes app from memory
Solution to lifecycle method complexity:
- Set up app in onCreate
- Load data in onResume
- Save data in onPause
- Tidy up app in onDestroy
_____ Loads the menu from menu_main.xml
onCreateOptionsMenu
_____ Directs execution to item selected
onOptionsItemSelected