First case

Run your application. Then just go back and leave it. Kill the app. Open Android Monitor, and from the device drop-down list, choose your device instance (emulator or real device). From the next drop-down list, choose the Journaler application package. Observe the following Logcat output:

You will notice the log messages we put in our source code.

Let's check how many times during our interaction with the application we entered the onCreate() and onDestroy() methods. Position your cursor on the search field and type on create. Observe the change in content--there is only one entry when we expected two: one for the main Application ...

Get Mastering Android Development with Kotlin 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.