August 2018

Privacy Policy

Kotlin RecyclerView with Click Listener

Create a RecyclerView in Android with Kotlin – A Step-by-Step Guide In today’s tutorial we’ll learn how to create a RecyclerView in Kotlin for Android with items that are clickable. This approach, distinct from the traditional ListView, offers a more dynamic and flexible way to display a scrollable list. Read on to discover how to […]

Privacy Policy

ListView with ViewHolder in Kotlin

In this post we will create a ListView with ViewHolder adapter but we will write the code in Kotlin. For creating xml files for ListView and list items, follow the steps from this post. Next, you have to create a new Kotlin class for the adapter. Name the new created file MyCustomAdapter MyCustomAdapter.kt import android.content.Context import

Privacy Policy

Kotlin Common Questions

1. Where should we keep constants in Kotlin? if you need constants to be accessed globally use const as top-level properties (not inside a class). In order to do this create a Kotlin file named Constants.kt. The file would look like this: This way you will be able to access the constants from anywhere within the

sponsored
Exit mobile version