fix illegalargumentexception in feed/cats sort triggered for some reason

when comparator changes in prefs
This commit is contained in:
Andrew Dolgov 2013-04-29 21:11:24 +04:00
parent 2af78be74b
commit 6a5ff27dce
2 changed files with 11 additions and 2 deletions

View File

@ -326,7 +326,11 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
}
}
Collections.sort(m_cats, cmp);
try {
Collections.sort(m_cats, cmp);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
try {
m_adapter.notifyDataSetChanged();
} catch (NullPointerException e) {

View File

@ -542,7 +542,12 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
}
}
Collections.sort(m_feeds, cmp);
try {
Collections.sort(m_feeds, cmp);
} catch (IllegalArgumentException e) {
// sort order got changed in prefs or something
e.printStackTrace();
}
try {
m_adapter.notifyDataSetChanged();