Questions
Kotlin questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Accessing Kotlin Extension Functions from Java
Learn how Kotlin extension functions are compiled and how to call them correctly from Java with clear examples and common pitfalls.
Android AlarmManager Example: Scheduling Tasks with AlarmManager
Learn how to use Android AlarmManager to schedule tasks, set alarms, and handle broadcasts with a simple beginner example.
Android Foreground Service Notification Channels in Kotlin
Learn why startForeground fails on Android 8.1 and how to create a valid notification channel for foreground services in Kotlin.
Can You Extend a Data Class in Kotlin? Inheritance, Limits, and Better Alternatives
Learn why Kotlin data classes cannot be extended, what causes the component function clash, and which alternatives to use instead.
Convert a Kotlin Array to Java varargs: Passing Arrays to Java Methods from Kotlin
Learn how to pass a Kotlin Array or ArrayList to a Java varargs method using the spread operator and type conversion.
Difference Between List and Array in Kotlin
Learn the difference between List and Array in Kotlin, including mutability, size, APIs, performance, and when to use each one.
Fix Incompatible Kotlin Metadata Version Error in Android/Gradle
Learn why the Kotlin metadata version error happens in Android builds and how to fix mismatched Kotlin and Gradle versions safely.
Fix KaptExecution Error in Android Kotlin: Data Binding and Build Generation
Learn why KaptExecution fails in Android Kotlin builds, especially with data binding and generated classes, and how to fix it step by step.
Fix compileJava and compileKotlin JVM Target Mismatch in Gradle Kotlin DSL
Learn how to set matching Java and Kotlin JVM targets in build.gradle.kts and fix compileJava 11 vs compileKotlin 1.8 errors.
Fixing "Default Interface Methods" Error in Android: Java 8, D8, and LifecycleObserver
Learn why Android shows the default interface methods error, how Java 8 affects minSdk, and how to fix it with D8 and Android lifecycle libraries.
Fixing "Inappropriate Blocking Method Call" in Kotlin Coroutines
Learn why Kotlin shows "inappropriate blocking method call" and how to correctly use blocking APIs like OkHttp and Moshi in coroutines.
Fixing NullPointerException When Accessing Views in a Kotlin Fragment
Learn why Fragment view access can cause NullPointerException in Kotlin and how to safely reference views in Android Fragments.
Generate a Random Number in a Specific Range in Java and Android
Learn how to generate random numbers in a specific range in Java for Android, with correct formulas, examples, and common mistakes.
How reified Works in Kotlin Generics
Learn how Kotlin's reified keyword works, why inline is required, and when reified generics differ from normal generic type parameters.
How to Call a Function After a Delay in Kotlin
Learn how to run code after a delay in Kotlin using sleep, timers, Android handlers, and coroutines with simple examples.
How to Check Type at Runtime in Kotlin: instanceof, is, and Smart Casts
Learn how to check an object's type at runtime in Kotlin using is, !is, when, and smart casts with clear examples.
How to Check Whether a lateinit Variable Is Initialized in Kotlin
Learn how to check if a lateinit property has been initialized in Kotlin, avoid crashes, and use safe patterns in real code.
How to Convert Kotlin to Java Source Files
Learn what is and is not possible when converting Kotlin source files to Java, plus practical options, tools, and beginner-friendly examples.
How to Convert a List to a Map in Kotlin
Learn how to convert a List to a Map in Kotlin using associate, associateWith, and toMap with clear examples and beginner-friendly explanations.
How to Copy or Clone a List in Kotlin
Learn how to copy or clone a list in Kotlin, including mutable and read-only lists, common patterns, pitfalls, and practical examples.
Page 1 of 4 - 62 questions