Making sure that we don't miss updates

This commit is contained in:
ByteHamster 2019-09-29 12:55:27 +02:00
parent 466e6a9b7e
commit 510f00e204
1 changed files with 4 additions and 3 deletions

View File

@ -409,8 +409,9 @@ public class FeedItemlistFragment extends ListFragment {
} }
private void onFragmentLoaded() { private void displayList() {
if(!isVisible()) { if (getView() == null) {
Log.e(TAG, "Required root view is not yet created. Stop binding data to UI.");
return; return;
} }
if (adapter == null) { if (adapter == null) {
@ -612,7 +613,7 @@ public class FeedItemlistFragment extends ListFragment {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(result -> { .subscribe(result -> {
feed = result.orElse(null); feed = result.orElse(null);
onFragmentLoaded(); displayList();
}, error -> Log.e(TAG, Log.getStackTraceString(error))); }, error -> Log.e(TAG, Log.getStackTraceString(error)));
} }