Merge pull request #5482 from osmandapp/FixException
Fix IllegalStateException
This commit is contained in:
commit
8d7331fd93
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 && isAdded()) {
|
||||
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