further use handlers in onArticleSelected()

This commit is contained in:
Andrew Dolgov 2012-09-20 23:10:23 +04:00
parent f1d50cad48
commit 2a02f4b211

View File

@ -157,13 +157,20 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL
} }
if (open) { if (open) {
FragmentTransaction ft = getSupportFragmentManager()
.beginTransaction();
final Article fArticle = article;
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
af.setActiveArticle(article);
ft.commit(); if (af != null) {
af.setActiveArticle(fArticle);
}
}
}, 10);
} else { } else {
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
if (hf != null) { if (hf != null) {