The lifecycle demonstration app
This quick experiment will help familiarize ourselves with the lifecycle methods our app uses, as well as give us a chance to play around with a bit more Java code:
Start a new project and call it
Lifecycle Demonstration
. Of course, the code is in the download bundle in theChapter 6/Lifecycle Demonstration
folder should you wish to refer to it or copy and paste it.Accept the default target devices.
Choose Blank Activity and don't worry about customizing the activity options at all.
Open the
MainActivity.java
file in the code editor, if it is not opened for you by default, by left-clicking on the MainActivity tab above the editor.
Note
If the previous steps were not detailed enough, check back to any of the previous occasions when we created a new project for further details.
You have created a new project with all the settings on default. We will only need the MainActivity.java
file for this demonstration and we will not be building a UI.
In the MainActivity.java...