Kotlin Advanced Concepts and Practical Patterns
Kotlin prvoides multiple ways to declare and manage properties with different initialization behaviors.
// Late-initialized property: must be assigned before use, can be reassigned
lateinit var userData: String
// Delegated property initialized lazily on first access
val userName: String by lazy { "sherlbon" }
// Nullable property w ...
Posted on Sun, 09 Aug 2026 16:34:08 +0000 by CooKies37
Handling Screen Orientation Changes in Android Fragments
When supporting both orientations, leverage ViewModel combined with DataBinding two-way binding to manage UI component data and states. Store text content, click handlers, visibility flags, and other UI properties within the ViewModel. This approach eliminates the need to serialize large amounts of data into Bundles during configuration changes ...
Posted on Sun, 05 Jul 2026 16:56:34 +0000 by nikbone