我在拥有两个父类(super class)时遇到了麻烦。当我添加 PreferenceFragment() 时,我收到错误:父类(super class)型列表中只能出现一个类 .
关于如何解决这个问题的任何想法?
class MyAccountFragment @Inject constructor(): BaseFragment(), PreferenceFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun initView() {
}
override fun initEvent() {
}
}
谢谢!
最佳答案
我找到了 Multi-inheritance in Kotlin through Composition作为解决方案。
关于android - Kotlin 只有一个类可以出现在父类(super class)型列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58759619/