Kotlin and Android Lifecycles

By Mark Allison on May 28, 2018


About

What are some strategies for dealing with Kotlin and Android Lifecycles?

In this screencast, cast you'll learn how Android Lifecycles appear to inhibit some core behaviors of Kotlin. For very good reasons Kotlin favors:

- Initialization of properties at the point where they are declared
- That we should try to avoid using nullable variables wherever possible
- That we should strive for immutability wherever possible.

Adhering to these principles appears to be difficult when we are operating within an Android lifecycle, such as an Activity, where often we cannot initialize properties until onCreate() because the Activity is not valid before that point. During this video, we’ll look at some strategies for overcoming these difficulties.

For the More Curious...

Lateinit Modifier | Kotlin Lang
Lazy Delegate | Kotlin Lang
BNR Guide to Kotlin
Android & Kotlin Courses

Transcript

Transcripts are only available for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Downloads

Project files are only available for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Comments