Created
August 3, 2018 11:20
-
-
Save kozmi55/2a96ccd487fdf8b7266ab3990757446b to your computer and use it in GitHub Desktop.
This file contains 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 MainActivity : AppCompatActivity() { | |
private val viewModel = UserViewModel() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
val adapter = UserAdapter() | |
recyclerView.layoutManager = LinearLayoutManager(this) | |
recyclerView.adapter = adapter | |
viewModel.startUpdates() | |
} | |
override fun onDestroy() { | |
viewModel.stopUpdates() | |
super.onDestroy() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment