I have a variable that is declared like
private lateinit var apiDisposable: Disposable
and then in onPause()
method, I am doing
override fun onPause() {
super.onPause()
if (!apiDisposable.isDisposed)
apiDisposable.dispose()
}
But I get this
kotlin.UninitializedPropertyAccessException: lateinit property apiDisposable has not been initialized
Can anyone tell me how could I check if this variable is initialized or not? Is there any method like isInitialised()
Any help would be appreciated