Actually I am getting a response using liveData+retrofit from API everything working fine in the first try ..if call the same API again its showing previous response first and then new response override the previous one. I debug the code and it happens because of Live data onChanged method called as I enter to the fragment so showing previous pojo result which is got at the first attempt. For some time it's showing the last result and once API response came then actual response load to recycler view.
viewModel.getMutuableData().observe(getActivity(), new Observer<Model>() {
@Override
public void onChanged(@Nullable Model model) {
list.clear();
if (model.getResult()) {
list.addAll(model.getCategoryList());
}
adapter.notifyDataSetChanged();
}
});