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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.