Activit页面
//for循环遍历title集合
for (int i = 0; i < list; i++) {
//创建Fragment
ShouYe_Toitiao_FuYongFragment shouYeFuYongFragment = new ShouYe_Toitiao_FuYongFragment();
//创建bundle对象存入需要传给Fragment的值
Bundle bundle = new Bundle();
bundle.putString("tag", list.get(i).getName());
//通过setArguments(bundle)传入bundle对象
shouYeFuYongFragment.setArguments(bundle);
//将fragment添加到fragement集合中
mFragments.add(shouYeFuYongFragment);
}
fragment页面
//通过getArguments()获取bundle对象
Bundle arguments = getArguments();
//通过标识获取具体内容
String tag = arguments.getString("tag");