【发布时间】:2018-11-27 11:59:21
【问题描述】:
这是我的班级,它的 primary constructor 没有 secondary constructor 没有 init 块。
class RowSubTShirtViewModel(private val subTShirtAdapter: SubTShirtAdapter, val context: TShirtActivity,
val tShirtBean: CommonItemBean, private val parentPosition: Int, private val position: Int) : BaseObservable(), TShirtActivity.setSelectionSubRow {}
创建像val vm=RowSubTShirtViewModel() 这样的对象会出错
- 创建抽象函数“RowSubTShirtViewModel”
- 创建函数“RowSubTShirtViewModel”
- 创建二级构造函数
- 没有为参数传递值
【问题讨论】:
-
亲爱的@farhana,关于this review,请注意Stack Overflow 有关于link-only-answers 的政策,甚至还有一个预定义的评论来处理这种情况。见"any link-only answer should be deleted. It is not an answer."