📜  android中的onbackpressed片段传递值 - Java代码示例

📅  最后修改于: 2022-03-11 14:52:31.593000             🧑  作者: Mango

代码示例1
FragmentTransaction ft = getActivity().getFragmentManager().beginTransaction();
    FragmentB frgamentB = new FrgamentB();
    fragmentB.setTargetFragment(FrgamentA.this, AppConstant.FRAGMENT_CODE);
    ft.addToBackStack(fragment.getClass().getName());
    ft.add(R.id.content, fragment, tag);
    ft.commit();