Error inflating Fragment in Dialog the second time

前端 未结 6 881
深忆病人
深忆病人 2020-12-03 08:31

I have the following code in an Activity that starts a dialog for a layout that contains a fragment.

...
case R.id.pick_resource:
        dialog = new Dialo         


        
6条回答
  •  一整个雨季
    2020-12-03 09:00

    Maybe this can help someone:

    I use the code of Эвансгелист Evansgelist, but with a DialogFragment that has a layout with a MapFragment, the code have to be onDestroy block:

    @Override
    public void onDestroy(){
        super.onDestroy();
        FragmentTransaction ft2 = getActivity().getFragmentManager()
                .beginTransaction();
    
        ft2.remove( getFragmentManager()
                .findFragmentById(R.id.map_map));
        ft2.commit();
    }
    

    This is my layout:

    
    
    
    
    

提交回复
热议问题