issue in Android Fragment : still click on previous fragment

前端 未结 2 505
醉梦人生
醉梦人生 2021-02-05 07:47

I have developed an application that have navigation Drawer and many fragment inside drawer so I getting issue while I am open fragment inside fragment, in one fragment I have L

2条回答
  •  我在风中等你
    2021-02-05 08:24

    Edit YOur code commit line from middle to end

        Fragment fragment = new FragmentContactDetails();
                    FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
                    transaction.add(((ViewGroup) getView().getParent()).getId(), fragment);
    
    
                    Bundle args = new Bundle();
                    int index = adapter.arrayList.indexOf(adapter.propertyList.get(position));
    
                    args.putInt(Constant.POSITION, index);
                    Toast.makeText(getActivity(), "" + index + "----" + adapter.propertyList.get(position).getName(), Toast.LENGTH_LONG).show();
                    fragment.setArguments(args);
    transaction.addToBackStack(null);
                    transaction.commit();
    

提交回复
热议问题