I\'m trying to use Kotlin with Butterknife for my Android Application.
Here is my build.gradle
dependencies {
...
compile \'com.jakewharton:b
In Kotlin, actually there is no need (or) necessity for going ButterKnife concepts. because in your activity you can directly refer the view _id of the layout file as referred below.
layout.xml
Activity.kt
btn_prestage.setBackgroundResource(R.drawable.staging_on)
btn_prestage.setOnClickListener{ view ->
Snackbar.make(view, "My Action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show() }
build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
dependencies {... }
}
kapt {
generateStubs = true
}