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
i would like to know that how to observe the changes in the mainActivity ..ie
like when network call is made and failed then how do you observe those changes
and you are not using the NetworkboundResource to update the UI like this ...
`if (listResource.data != null) {
switch (listResource.status) {
case LOADING: {
// if(mRecipeListViewModel.getPageNumber() > 1){
// mAdapter.displayLoading();
// }
// else{
// mAdapter.displayOnlyLoading();
// }
// break;
}
case ERROR: {
Timber.e("onChanged: cannot refresh the cache.");
Timber.e("onChanged: ERROR message: %s", listResource.message);
Timber.e("onChanged: status: ERROR, #recipes: %s", listResource.data.size());
// mAdapter.hideLoading();
// mAdapter.setRecipes(listResource.data);
// Toast.makeText(RecipeListActivity.this, listResource.message, Toast.LENGTH_SHORT).show();
//
// if(listResource.message.equals(QUERY_EXHAUSTED)){
// mAdapter.setQueryExhausted();
// }
// break;
}
case SUCCESS: {
Timber.d("onChanged: cache has been refreshed.");
Timber.d("onChanged: status: SUCCESS, #Recipes: %s", listResource.data.size());
// mAdapter.hideLoading();
// mAdapter.setRecipes(listResource.data);
break;
}`
kindly help me understand as I don't see that you are using anywhere the Resource Generic to handle the UI updates.
The text was updated successfully, but these errors were encountered:
i would like to know that how to observe the changes in the mainActivity ..ie
like when network call is made and failed then how do you observe those changes
and you are not using the NetworkboundResource to update the UI like this ...
The text was updated successfully, but these errors were encountered: