fix crash in sortfeeds/sortcats when adapter is already destroyed

This commit is contained in:
Andrew Dolgov 2012-09-26 09:51:16 +04:00
parent 83fa1ace29
commit fb7792125b
2 changed files with 11 additions and 2 deletions

View File

@ -317,7 +317,11 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
}
Collections.sort(m_cats, cmp);
m_adapter.notifyDataSetInvalidated();
try {
m_adapter.notifyDataSetInvalidated();
} catch (NullPointerException e) {
// adapter missing
}
}

View File

@ -546,7 +546,12 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
}
Collections.sort(m_feeds, cmp);
m_adapter.notifyDataSetInvalidated();
try {
m_adapter.notifyDataSetInvalidated();
} catch (NullPointerException e) {
// adapter missing
}
}
public class GetIconsTask extends AsyncTask<FeedList, Integer, Integer> {