In kotlin I have two fragments - first fragment and second fragment, which extends first fragment. But during compiling of my app I have an error:
FragmentAllTags.kt: (9, 20): Primary constructor call expected.
Please, help me fix this error for child class, to for constructor without params called constructor with empty list argument, and if I will call constructor with param - variable get value of param from constructor, i.e as it works in parent class.
Parent class:
open class FragmentAllCategories(var categories: MutableList<ModelCategory>) : Fragment() {
constructor(): this(mutableListOf<ModelCategory>()) {
}
…
}
child class:
class FragmentAllTags(categories: MutableList<ModelCategory>): FragmentAllCategories(categories) {
constructor(): super() {
}
…
}