Kotlin: using lateinit
Example:
class MyPresenter {
lateinit var view: MyView
}
The lateinit keyword allows you to initialize non-null properties outside the constructor.
Solution:
val presenter = MyPresenter()
presenter.view = MyView()
Example: Solution:Kotlin: using lateinit
The lateinit keyword allows you to initialize non-null properties outside the constructor.
class MyPresenter {
lateinit var view: MyView
}
val presenter = MyPresenter()
presenter.view = MyView()