Last active
November 6, 2018 14:47
-
-
Save sanogueralorenzo/778419251a2023717bc05b518dc5be08 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 PostListActivity : AppCompatActivity() { | |
@Inject | |
lateinit var viewModelFactory: ViewModelProvider.Factory | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_post_list) | |
getAppInjector().inject(this) | |
val vm = ViewModelProviders.of(this, viewModelFactory)[PostListViewModel::class.java] | |
vm.posts.observe(this, Observer(::updatePosts)) | |
} | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PostListViewModel have 2 inputs in constructor ! idont see in activity or your di or any files in your medium example