这是我的Fragment_vent
。如何将数据从Fragment_vent
传递到另一个Fragment
? (putExtra("ext",IDV_L))
@Override
public void onClick(View v) {
IDV_L = date();
Fragment fragment = null;
fragment = new Fragment_Inicio_Tab();
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frame_container, fragment).commit();
}
答案 0 :(得分:1)
使用以下代码......
Fragment fragment = null;
fragment = new Fragment_Inicio_Tab();
Bundle args = new Bundle()
args.putString("value1", value1);
args.putString("value2", value2);
fragment.setArguments(args);
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.frame_container, fragment).commit();
并将片段作为..
getArguments().getString("value1");
getArguments().getString("value2");
答案 1 :(得分:0)
QMenu