From the course: Android Development Essential Training: App Architecture with Kotlin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Trace lifecycle events with Logcat

Trace lifecycle events with Logcat - Android Tutorial

From the course: Android Development Essential Training: App Architecture with Kotlin

Start my 1-month free trial

Trace lifecycle events with Logcat

- [Instructor] Understanding the activity life cycle is critical for Android developers. Each time an activity changes its state the framework calls a function of the activity class. And you can react to these events by overriding those functions. Now you can follow along with these steps in any Android project that uses Kotlin. I'm using the appropriate branch for this video from the GitHub Repo. I'll place the cursor inside the on create function and down here at the bottom of the code I'll use the log class. This class is from the Android dot util package and it has to be imported in order to use it. When I select it, the appropriate import is added up here. In order to trace your events you can use any of the functions that start with a single character. Each of these characters represents one of these messaging levels from assert to debug, error, info, verbose, and warn. And these give you a way of filtering your messages. I'll use I for info and I'll need to pass in a string as…

Contents