igor.wojda
11/24/2018, 7:00 PMstreetsofboston
11/24/2018, 11:04 PMid
using the Intent
that starts the Activity. Then when creating an instance of your AlbumDetailsViewModel, provide the id
by doing intent.getStringExtra
igor.wojda
11/25/2018, 9:01 AMViewModel.Factory
). It would be preferable to inject this factory into activity, however factory requires a bit of configuration (album Id) before it is constructed 🤔streetsofboston
11/25/2018, 5:25 PMbindViewModel
, that takes a KodeinAware
as a second receiver, a lambda as a parameter, and uses a custom ViewModel.Factory
for its implementation. The lambda will return a new ViewModel
when it is called. This allows for arguments (eg the intent extra) to be provided.igor.wojda
11/26/2018, 9:21 AM