public static FeedFragment newInstance(MajorTeamGsonModel model) { FeedFragment fragment = new FeedFragment(); Bundle args = new Bundle(); args.putParcelable("MajorTeamGsonModel", model); fragment.setArguments(args); return fragment; }
private void onFeedClicked() { index = 2; if (mFragment instanceof FeedFragment) { // ((BaseTournamentFragment)mFragment).getRefresh(); EventBus.getDefault().post(new BottomItemRefreshEvent(2)); } else { initBottomButton(); FragmentTransaction ft = fMgr.beginTransaction(); if (mFragment instanceof BaseNewsFragment) { ft.hide(mFragment); } else if (mFragment != null) { ft.remove(mFragment); } if (mFeedFragment == null) { mFeedFragment = FeedFragment.newInstance(majorTeamGsonModel); ft.add(R.id.fragmentRoot, mFeedFragment); } else { ft.show(mFeedFragment); } mFragment = mFeedFragment; ft.commitAllowingStateLoss(); MobclickAgent.onEvent(getApplication(), UmengEvent.FEED_FRAGMENT); } }