Hi All,
I want to create a cached MutableLiveData class, I can create it in Java, but not in Kotlin. I started to copy MutableLiveData code from Android system & paste in a Kotlin file with Android studio.
open class MutableLiveData<T> : LiveData<T?> {
constructor(value: T) : super(value) {}
constructor() : super() {}
override fun postValue(value: T) {
super.postValue(value)
}
override fun setValue(value: T) {
super.setValue(value)
}
}
Compiler said setValue() & postValue() overrides nothing. I saw the original postValue of LiveData and there is no @hide annotation in it:
protected void postValue(T value) {
boolean postTask;
...
}
How can I solve this problem?
thx
Zamek