is there nicer way, to lazy initialize nullable property, without then using !! ?
u
is there nicer way, to lazy initialize nullable property, without then using !! ?
h
You can get rid of the
!!
on the fragment:
Copy code
progressDialogFragment?.let {
  if (!it.isAdded) it.show(fragmentManager!!, TAG_PROGRESS_DIALOG)
}
Notice however, that this doesn't throw if the fragment is not initialized (you could add a
?: error("not initialized")
or similar at the end though)