通过bundle传递参数的时候,在新的页面接收参数,可以通过
发送页面传递参数:
Bundle todetailBundle = new Bundle();
todetailBundle.putString("inter_id", inter_id);
WeihuEditDetail weihuEditDetail = new WeihuEditDetail();
FragmentManager fm1 = getFragmentManager();
FragmentTransaction ft1 = fm1.beginTransaction();
weihuEditDetail.setArguments(todetailBundle);
ft1.replace(R.id.frag_container_linearyout,
weihuEditDetail, "weihueditdetail");
ft1.commit();
接收方判断bundle是否含有所传的值,如果有值对值进行读取和赋值操作:
private String inter_id_tobeedit;
if(bundle!=null&&bundle.containsKey("inter_id")){
inter_id_tobeedit = bundle.getString("inter_id");
}