You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following your development for nutrilicious app i did not manage to get the recyclerview loaded with "favorites".
I guess something goes wrong with observeFavorites() in Favoritesfragment.
For the line :
favorites.observe(this@FavoritesFragment, Observer { foods ->
foods?.let {
launch(UI) {
(rvFavorites.adapter as? SearchListAdapter)?.setItems(foods)
}
}
the app crashes with :
"java.lang.IllegalStateException: Cannot invoke observe on a background thread"
Also use of "launch" as in your examples is deprecated, changes i made to overcome did not lead to this crash but did not load the recyclerview either.
Hello Peter,
Following your development for nutrilicious app i did not manage to get the recyclerview loaded with "favorites".
I guess something goes wrong with observeFavorites() in Favoritesfragment.
For the line :
favorites.observe(this@FavoritesFragment, Observer { foods ->
foods?.let {
launch(UI) {
(rvFavorites.adapter as? SearchListAdapter)?.setItems(foods)
}
}
the app crashes with :
"java.lang.IllegalStateException: Cannot invoke observe on a background thread"
Also use of "launch" as in your examples is deprecated, changes i made to overcome did not lead to this crash but did not load the recyclerview either.
Hope this helps to help me further..
Regards,
Kees Dil,
keesdil@hotmail.com
The text was updated successfully, but these errors were encountered: