Fragment之间传递参数

时间:2014-06-22 18:10:27   收藏:0   阅读:171

传递参数的方法


//要跳转到的Fragment
MapF f=new MapF();
//传递的参数
Bundle args = new Bundle();
args.putString("position","1");
f.setArguments(args);
//跳转
getFragmentManager().beginTransaction().replace(R.id.car_main_fragment, f).commit();



得到参数


getArguments().getString("position")


Fragment之间传递参数,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!