Last active
April 1, 2019 03:52
-
-
Save hansenji/886412cf69a02f3045159ac67496b859 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyViewModel | |
@ViewModelInject constructor( | |
Long foo, @Assisted SavedStateHandle savedStateHandle | |
): ViewModel() { | |
//... | |
} | |
@ViewModelModule | |
@Module(includes = ViewModelInject_VMModule::class) | |
abstract class VMModule {} | |
class MyActivity: Activity { | |
@Inject | |
lateinit var viewModelFactoryFactory: SavedStateViewModelFactory.Factory | |
val viewModel by viewModels<MyViewModel> { viewModelFactoryFactory.create(this, intent.extras) } | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment