I need something that can make my class nullable/optional because of the runtime errors that is happening on some devices.
Is this possible?
class M
I had the same problem and solved like this:
@Inject
@JvmField
var presenter: Presenter? = null
Hope it helps.
If you don't have Java code that needs to access the presenter
field you don't need to annotate it with @JvmField
. Instead, you can declare your field like so:
@set:Inject
var presenter: Presenter? = null