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();
ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); final Article fArticle = article;
af.setActiveArticle(article);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
if (af != null) {
af.setActiveArticle(fArticle);
}
}
}, 10);
ft.commit();
} else { } else {
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
if (hf != null) { if (hf != null) {