Skip to content

Instantly share code, notes, and snippets.

@mlykotom
Last active January 3, 2020 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlykotom/e4318ca4be5cb4f2a118011b35034e75 to your computer and use it in GitHub Desktop.
Save mlykotom/e4318ca4be5cb4f2a118011b35034e75 to your computer and use it in GitHub Desktop.
Connecting The Dots :: Motivation - parameters after initialization of ViewModel
class SomeViewModel @Inject constructor(
private val depFromDagger1: Dependency,
private val depFromDagger2: Dependency2
) : ViewModel(){
// may crash with UninitializedPropertyAccessException
lateinit var articleId: String
// must !! or ?. for every access
var fragmentParams: Bundle? = null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment