Skip to content

Instantly share code, notes, and snippets.

@gastsail
Created March 23, 2020 15:57
Show Gist options
  • Save gastsail/3798bc1f0a71f78ea00ac49abbced4f2 to your computer and use it in GitHub Desktop.
Save gastsail/3798bc1f0a71f78ea00ac49abbced4f2 to your computer and use it in GitHub Desktop.
//ViewModel
fun getHashMapData():LiveData<HashMap<String,Cart>>{
return cartHashMap
}
//UI that gets this hashmap
sharedViewModel.getHashMapData().observe(viewLifecycleOwner, Observer { dataHashMap ->
//Here I need to transform this HashMap into a MutableList<Cart>
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment