Questions related to Kotlin Android Extensions
Questions tagged [kotlin-android-extensions]
721 questions
10
votes
2 answers
Do Kotlin Android Extensions cache the synthetic properties or each time it calls findViewById()?
If I have a simple custom view:
myitem.xml

WindRider
- 11,958
- 6
- 50
- 57
10
votes
2 answers
Kotlin - What is the use of class without body?
In Kotlin both the header and the body are optional; if the class has no body, curly braces can be omitted.
So we can define class like,
class Empty
What is the use of this type of class?

paril
- 1,850
- 2
- 14
- 26
10
votes
5 answers
Varargs Kotlin Java interop not working properly
For the makeSceneTransitionAnimation there are two static functions
public static ActivityOptionsCompat makeSceneTransitionAnimation(Activity activity,
View sharedElement, String sharedElementName)
and
public static…

Josh Feinberg
- 133
- 1
- 8
10
votes
3 answers
Kotlin Android extensions and retained fragment
I am using Kotlin Android extensions in my project and I came across some behavior that I am unable to understand. I use this code to retain my fragment in the activity:
val fragment = fragmentManager.findFragmentByTag("hello") ?:…

Lamorak
- 10,957
- 9
- 43
- 57
9
votes
2 answers
Switch to Kotlin 1.3.30 breaks hashCode only on Android API 21
I switched over my Android project from 1.3.20 to 1.3.30 and I am suddenly getting following exceptions from some of the classes when they call hashCode() method. Note, I am getting this exception only on Android platform API 21 & 22, beyond Android…

Subodh Nijsure
- 3,305
- 5
- 26
- 45
9
votes
1 answer
Using android-extensions`s Parcelize annotation on objects that extends Parceable sealed classes
I'm using kotlin android extensions to auto generate my Parcelables, but given the following code I'm getting 'Parcelable' should be a class.
the code:
sealed class Action : Parcelable
@Parcelize
object Run : Action()
@Parcelize
data class Ask(
…

ademar111190
- 14,215
- 14
- 85
- 114
9
votes
1 answer
Experimental features in Android extension is good for Production release
I'm using the @Parcelize feature in android development using Kotlin language.
To use them I have done the below modifications in build.gradle file.
apply plugin: 'kotlin-android-extensions'
then
androidExtensions {
experimental = true
}
I'm…

Swaminathan V
- 4,663
- 2
- 22
- 32
9
votes
2 answers
Adding kapt to use Room causes compile errors
I added apply plugin: 'kotlin-kapt' to be able to use Rooms annotation proccessor:
compile "android.arch.persistence.room:runtime:1.0.0"
kapt "android.arch.persistence.room:compiler:1.0.0"
However when I build my project I get:
Folder…

Derek
- 196
- 1
- 12
9
votes
1 answer
Kotlin function required Nothing but defined as a different type
I've defined a class like so
abstract class MvpViewHolder
(itemView: View) : RecyclerView.ViewHolder(itemView) where P : BasePresenter

Rafa
- 3,219
- 4
- 38
- 70
9
votes
2 answers
ButterKnife @OnClick annotation not working in Kotlin fragment
I like the readability of the @OnClick attribute from ButterKnife: hence, I'm using it even in Kotlin. Unfortunately, the click handler just isn't being fired when I click. Am I missing something? Is there something I have to do to integrate the…
user2836797
9
votes
2 answers
Can not inherit from final class
I have just created my first android library. At another application I want to extend a class from the it. But it shows me an error: "Cannot extend from final 'library.com.kukaintro.activities.KukaIntro'".
As you can see none of the super classes…

CyberUser
- 348
- 1
- 4
- 13
9
votes
2 answers
What does the warning «Use properties from the build variant packages» mean?
What does this warning mean?
It is appeared in version 1.0.0-beta-3595 for all usages of kotlin android extensions in my code.

Artyom Krivolapov
- 3,161
- 26
- 32
9
votes
1 answer
Kotlin Gradle issue
I have created a Jar of a project written in Kotlin language. Jar contains following folders :
com
jet
kotlin
meta-inf
okio
org
Then I created an android project and added Kotlin and the Jar as dependency.
When I try to execute the hello world app…

manish
- 944
- 2
- 14
- 27
8
votes
1 answer
Not able to access parent class variable in child class in kotlin
In kotlin I am trying to use parent class variables in child class but I am not able to use them ,as I am new to kotlin I don't understand how to do it simply
I am trying to access sharedPerfernces and getting but its giving me null
class…

Danial clarc
- 724
- 1
- 7
- 25
8
votes
2 answers
Benefits of Databinding in kotlin?
I would like to know the benefits of writing extra code to implement dataBinding in Kotlin when developing Android Apps.
Because Kotlin extensions already allows us to access the views directly without the need of findViewById's.

Doilio Matsinhe
- 2,131
- 16
- 29