galex
04/12/2019, 6:22 AMpublic abstract class ViewModel {
protected void onCleared() {
}
}
I hoped the following would work:
expect abstract class ViewModel {
protected fun onCleared()
}
And on Android declare it this way:
actual typealias ViewModel = androidx.lifecycle.ViewModel
But because protected means different things in Kotlin and Java, I get the following error: protected final expect fun onCleared(): Unit
is incompatible because visibility is different from protected/*protected and package*/ open fun onCleared(): Unit
. Am I stuck here or is there a way to go around this?yshrsmz
04/12/2019, 11:13 AMrusshwolf
04/12/2019, 11:38 AMgalex
04/13/2019, 5:27 AM