/** 更新评论界面 */ private void updateCommentFragment(int newsId) { FragmentManager fm = getSupportFragmentManager(); String tag = mAdapter.getTab(1).tag; Fragment fragment = fm.findFragmentByTag(tag); if (fragment != null && fragment instanceof UpdateDatasEvent) { UpdateDatasEvent event = (UpdateDatasEvent) fragment; event.onNotifyUpdate(newsId); } else { L.d("comment is null"); } }
/** 更新资讯内容数据 */ private void updateBodyFragment(News news) { // 更新adapter里的数据 TabInfo info = mAdapter.getTab(0); FragmentManager fm = getSupportFragmentManager(); String tag = info.tag; Fragment fragment = fm.findFragmentByTag(tag); if (fragment != null && fragment instanceof UpdateDatasEvent) { UpdateDatasEvent event = (UpdateDatasEvent) fragment; event.onNotifyUpdate(news); } else { L.d("body is null"); info.args.putSerializable(Contanst.NEWS_DATA_KEY, news); } }