sreich
02/25/2017, 5:25 PMbernhard
02/25/2017, 5:40 PMsreich
02/25/2017, 5:41 PMbernhard
02/25/2017, 5:46 PMmg6maciej
02/25/2017, 6:12 PMlateinit
is var
!lazy(NONE) { ... }
whenever I can and for example Disposable
/ Subscription
from RxJava as lateinit var
if a call to API is made in onCreate
.bernhard
02/25/2017, 6:38 PMonCreate
lazy shouldn't be used when the lazy-block is dependent on the state of the containing object because it isn't really determined when it is called by design (you have to be aware in your code). but aside from this you could use it any other time.
But I would not use it everytime because there is still some overhead of lazy to direct initialization, depends on use case