Privacy Policy

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

Privacy Policy

Kotlin – for, while, if, when

Control flow: for, while, if, when This post is for beginners who want to start learning Kotlin language and already know Java. We will show simple examples of for, while, if, when in both languages, in parallel, for an easier understanding. We will use Log.e in order to print string messages, as from our point of view,

, , , , , , , , , , ,
Privacy Policy

Kotlin – Hello world

Introduction What is Kotlin? It is a new programming language built by JetBrains, and as you may already know, Google announced at Google I/O 2017, that they will now officially support this language. It is inspired by existing languages such as Java, C#, JavaScript, Scala and Groovy. What are the advantages of using Kotlin? it’s

,
sponsored
Exit mobile version