codeslubber
10/02/2017, 3:29 PMpublic class MyActivity extends AppCompatActivity {
public void onCreate(Bundle savedInstanceState) {
MyViewModel model = ViewModelProviders.of(this).get(MyViewModel.class);
model.getUsers().observe(this, users -> {
// update UI
});
}
}
Obviously this is Java. In getting a syntax for the observer that would compile in Kotlin, I ended up doing an Observer<ModelType>(){} construct, is this as it should be?