Top "Kotlin-extension" questions

Kotlin provides the ability to extend a class with new functionality without having to inherit from the class or use any type of design pattern such as Decorator.

Deep copy of list with objects in Kotlin

I am new to kotlin and I am trying to make a copy of a list of objects.The problem …

android kotlin kotlin-android-extensions kotlin-extension
how to instantiate an object from a class in kotlin

I am learning Kotlin, and I googled how to create a class in kotlin. So, I created the below class …

android kotlin kotlin-android-extensions kotlin-extension
Kotlin: How to extend the enum class with an extension function

I'm trying to extend enum classes of type String with the following function but am unable to use it at …

enums kotlin kotlin-extension
Extension functions for generic classes in Kotlin

What's wrong with my extension function below class Foo<T> { fun <T> Foo<T>.…

generics kotlin kotlin-extension
Out-projected type 'ArrayList<*>' prohibits the use of 'public open fun add(index: Int, element: E): Unit defined in java.util.ArrayList'

I have this snippets: class RecyclerViewAdapter internal constructor( val clazz: Class<out RecyclerViewViewHolder>, val layout: Int, var dataList: …

generics kotlin kotlin-android-extensions kotlin-extension
Android Java Project Converts to Kotlin in Android Studio

I want to convert my java project to Kotlin, there are more than 500 java files. How can I convert it …

android android-studio kotlin kotlin-extension
Android Studio and Kotlin: Unresolved reference: also

also compiles and runs from Android Studio: val greeted = "World".also { println("Hello $it") } Yet the editor highlights also and …

android android-studio kotlin kotlin-extension
How to parse below Json data in Kotlin?

I need to parse this information- [ { "artist": "12", "image": "23" }, { "video_id": "12", "video_title": "23" }, { "video_id": "12", "video_title": "23" }, { "video_id": "12", "video_title": "23" }, { "…

kotlin android-volley kotlin-android-extensions kotlin-extension rx-kotlin
How to use ViewModelProviders in Kotlin

I am new bie to Kotlin, Please help me how to use ViewModelProviders.of(this) in Kotlin My code in …

android kotlin kotlin-android-extensions kotlin-extension
Create EnumMap from List of values in Kotlin

I would like to define an extension of the enum class which accepts a list of values in the same …

kotlin kotlin-extension enum-map