fix IllegalStateException
This commit is contained in:
parent
c7d77a1373
commit
bad6f228a3
2 changed files with 3 additions and 2 deletions
|
@ -83,7 +83,7 @@ public class SavedArticlesTabFragment extends BaseOsmAndFragment implements Trav
|
|||
|
||||
@Override
|
||||
public void savedArticlesUpdated() {
|
||||
if (adapter != null) {
|
||||
if (adapter != null && getActivity() != null) {
|
||||
List<Object> newItems = getItems();
|
||||
SavedArticlesDiffCallback diffCallback = new SavedArticlesDiffCallback(adapter.getItems(), newItems);
|
||||
DiffUtil.DiffResult diffRes = DiffUtil.calculateDiff(diffCallback);
|
||||
|
|
|
@ -298,7 +298,8 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
|
|||
private void updateFragments() {
|
||||
ExploreTabFragment exploreTabFragment = getExploreTabFragment();
|
||||
SavedArticlesTabFragment savedArticlesTabFragment = getSavedArticlesTabFragment();
|
||||
if (exploreTabFragment != null && savedArticlesTabFragment != null) {
|
||||
if (exploreTabFragment != null && savedArticlesTabFragment != null
|
||||
&& exploreTabFragment.isAdded() && savedArticlesTabFragment.isAdded()) {
|
||||
exploreTabFragment.populateData();
|
||||
savedArticlesTabFragment.savedArticlesUpdated();
|
||||
updateNeeded = false;
|
||||
|
|
Loading…
Reference in a new issue