11 Introtoandroid
11 Introtoandroid
Demo
The slightly
ungrammatical
phrase of “Hello
World, Hello!” was
hiding in the
strings.xml file that is
a part of our app’s
standard resources
sent to background
Thus, if your
onPause()
app needs to
Process
save data Killed
no longer visible
persistently, onStop()
the save
needs to
happen in onDestroy()
onPause()
© Kenneth M. Anderson, 2011 29
Tuesday, February 15, 2011
Let’s see this in action
Create new application
Project Name: Life Cycle
Build Target: Android 2.3 (or whatever you downloaded)
Application Name: Activity Life Cycle
Package Name: org.example.lifecycle
Activity: LifeCycle
Min SDK: 9
Define layout for both screens… both will have a title and
a button. They will each have a different background color
Colors will be defined in res/values/colors.xml