CategoryNavigationEntry: check if fragment is missing before enabling it

This commit is contained in:
Andrew Dolgov 2012-09-09 11:50:14 +04:00
parent 623aac676e
commit 4e4739af55

View File

@ -183,15 +183,17 @@ public class MainActivity extends CommonActivity implements OnlineServices {
if (m_activeFeed.is_cat) {
FeedCategoriesFragment cats = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS);
ft.show(cats);
cats.setSelectedCategory(null);
if (cats != null) {
ft.show(cats);
cats.setSelectedCategory(null);
}
} else {
FeedsFragment feeds = (FeedsFragment) getSupportFragmentManager().findFragmentByTag(FRAG_FEEDS);
ft.show(feeds);
feeds.setSelectedFeed(null);
if (feeds != null) {
ft.show(feeds);
feeds.setSelectedFeed(null);
}
}
} else {