Skip to content Skip to sidebar Skip to footer

Android Fragment - Application Crashed After Closing Application

In my application I am using google map in fragment. I am using this code for adding fragments. public void addPage(final BaseFragment pBaseFragment, final boolean isAddToBackSta

Solution 1:

Try this way:

   @Override
    public void onDestroyView ()
    {
        try{
          SupportMapFragment fragment = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.map_n));
          FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
          ft.remove(fragment);
          ft.commit();
        }catch(Exception e){
        }
      super.onDestroyView();  
  }

Post a Comment for "Android Fragment - Application Crashed After Closing Application"