Lifecycle demo app

In this section, we will do a quick experiment that 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.

Follow these steps to start a new project, and then we can add some code:

  1. Start a new project and call it Lifecycle Demo. Of course, the code is in the download bundle in the Chapter 6/Lifecycle Demo folder should you wish to refer to it or copy and paste it.
  2. Accept the default target devices.
  3. Choose Basic Activity and don't worry about customizing the activity options on the Configure Activity screen.
  4. Wait for Android Studio to generate the project files, and then open the MainActivity.java file in the code editor (if it is not opened for ...

Get Android Programming for Beginners - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.