码迷,mamicode.com
首页 > 其他好文 > 详细

Fragment事物

时间:2016-07-01 09:00:18      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

if (fragments.size() > 0) {
for (int i = 0; i < fragments.size(); i++) {
FragmentTransaction transaction = supportFragmentManager.beginTransaction();
transaction.remove(fragments.get(i).getFragment());
transaction.commitAllowingStateLoss();
}
fragments.clear();
}

Log.d("aaa", "fragments=" + fragments.size());
for (int i = 0; i < titleNames.size(); i++) {
MyFragment fragment = new MyFragment();
FragmentItem fragmentItem = new FragmentItem();
Bundle bundle = new Bundle();
Log.d("aaa", "getFragments: " + titleNames.get(i).getName());
bundle.putString("text", titleNames.get(i).getName());
fragment.setArguments(bundle);
fragmentItem.setFragment(fragment);
fragmentItem.setMatter(titleNames.get(i).getName());
fragments.add(fragmentItem);
}

Fragment事物

标签:

原文地址:http://www.cnblogs.com/bwandroid/p/5631802.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!