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,16 +183,18 @@ public class MainActivity extends CommonActivity implements OnlineServices {
if (m_activeFeed.is_cat) { if (m_activeFeed.is_cat) {
FeedCategoriesFragment cats = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS); FeedCategoriesFragment cats = (FeedCategoriesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_CATS);
if (cats != null) {
ft.show(cats); ft.show(cats);
cats.setSelectedCategory(null); cats.setSelectedCategory(null);
}
} else { } else {
FeedsFragment feeds = (FeedsFragment) getSupportFragmentManager().findFragmentByTag(FRAG_FEEDS); FeedsFragment feeds = (FeedsFragment) getSupportFragmentManager().findFragmentByTag(FRAG_FEEDS);
if (feeds != null) {
ft.show(feeds); ft.show(feeds);
feeds.setSelectedFeed(null); feeds.setSelectedFeed(null);
} }
}
} else { } else {
findViewById(R.id.article_fragment).setVisibility(View.GONE); findViewById(R.id.article_fragment).setVisibility(View.GONE);