Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Android Activity Lifecycle Course (How To)

via Treehouse

Overview

Activities are a crucial component of almost any Android app. In this course we will learn about the lifecycle of our activities, and how we can handle various unexpected changes. We'll also see how to correctly handle a device rotation as well as how to save data using SharedPreferences. To top it all off, at the end of this course you'll get a chance to test your Android knowledge with a project.

What you'll learn

  • Saving and Retrieving Instance State
  • Activity Lifecycle
  • SharedPreferences

Syllabus

The Activity Lifecycle

In this stage we'll learn the Android activity lifecycle. We'll start with an overview of why the activity lifecycle is so important. Then we'll see how to use bundles to save our instance state. Lastly, we'll get a comprehensive overview of the entire activity lifecycle.

Chevron 8 steps
  • The Problem with Activities

    2:03

  • The Problem with Activities

    2 questions

  • Saving Instance State

    7:00

  • Saving Instance State

    2 questions

  • Retrieving Instance State

    8:36

  • Saving and Retrieving Instance State

    3 objectives

  • Activity Lifecycle Overview

    6:23

  • Activity Lifecycle Overview

    3 questions

Introducing SharedPreferences

In this stage we'll continue learning about the activity lifecycle and introduce SharedPreferences. We'll start with an example app to demonstrate the activity lifecycle in action. Then we'll see how to save and retrieve data using SharedPreferences.

Chevron 6 steps
  • Logging the Lifecycle Methods

    5:40

  • Lifecycle Methods Review

    2 questions

  • Introduction to SharedPreferences

    6:36

  • Introduction to SharedPreferences

    2 questions

  • Saving and Retrieving Data with SharedPreferences

    4:24

  • Saving and Retrieving Data with SharedPreferences

    4 objectives

The Project

In this stage you'll get the chance to test what you've learned with a project. I'll give you the specs of the project in the first video, and then it's your time to shine! If you get stuck, the remaining videos show how I chose to implement the project.

Chevron 7 steps
  • Introducing the Project

    1:24

  • Updating and Creating Layout Files

    5:19

  • Creating a Hole Object

    3:38

  • Creating the Adapter

    12:17

  • Implementing SharedPreferences

    4:21

  • Adding the Menu

    7:04

  • Retrospective

    1 objective

Reviews

Start your review of Android Activity Lifecycle Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.