List<Fragment> fragments = new ArrayList<>();
for (int i = 0; i < mCategoryEntityList.size(); i++) {
DefualInfoFragment meFragment = new DefualInfoFragment();
Bundle bundle = new Bundle();
bundle.putString(Constant.CHANNEL_CODE,i+"");
meFragment.setArguments(bundle);
fragments.add(meFragment);
}
這個寫在外層的(生成Fragment的地方)
name = getArguments().getString(Constant.CHANNEL_CODE);
這個寫在DefualInfoFragment中
然後就可以用name去判斷了