Q:

Fragment with RecyclerView doesn't show second time until change orientation

I have a fragment containing a RecyclerView and a button. The fragment is brought up on pressing a button (which adds some data) in a previous fragment, and the recycler shows correctly populated, the button works. Then I go back to the previous fragmen, press the button again (adding more data) and the same piece of code brings up the same fragment, but the RecyclerView is unpopulated and the button doesn't work. From reading this question my guess is that I am doing something in my Fragment management - because as soon as I change orientation and the Fragment is recreated, the list shows fine and the button works fine.
So here is the management I'm doing on the fragments - I took it from an example on the internet, but I'm worried it's not correct
First there is a Base class which I make for my fragments: 
public class BaseFragment extends Fragment {

    private AbstractFragmentCallback mCallback;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        try {
            mCallback = (AbstractFragmentCallback) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                + " must implement " + 
AbstractFragmentCallback.class.getCanonicalName());
        }

    }

    /**
     * This method replaces the currently shown fragment with a new 
fragment of a particular class.
     * If a fragment of the required class already shown - does 
nothing.
     * @param clazz the class of the fragment to show
     * @param addToBackStack whether the replacement should be added 
to back-stack
     * @param args arguments for the newly created fragment (can be 
null)
     */
    public void replaceFragment(Class<? extends Fragment> clazz, 
boolean addToBackStack,
                            Bundle args) {
        mCallback.replaceFragment(clazz, addToBackStack, args);
    }

    public interface AbstractFragmentCallback {

        /**
         * Call to this method replaces the currently shown fragment 
with a new one
         *
         * @param clazz           the class of the new fragment
         * @param addToBackStack whether the old fragment should be 
added to the back stack
         * @param args           arguments to be set for the new fragment
         */
        void replaceFragment(Class<? extends Fragment> clazz, boolean addToBackStack,
                         Bundle args);

    }

}

So then my MainActivity implements the BaseFragment.AbstractfragmentCallback so:
public class MainActivity extends AppCompatActivity implements BaseFragment.AbstractFragmentCallback {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(....);

    if (null == savedInstanceState) {
        replaceFragment(WelcomeFragment.class, false, null);
    }
}

// ---------------------------------------------------------------------------------------------
//
// Fragments management

@Override
public void replaceFragment(Class<? extends Fragment> clazz, boolean addToBackStack,
                            Bundle args) {
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

    Fragment newFragment;

    try {
        // Create new fragment
        newFragment = clazz.newInstance();
        if (args != null) newFragment.setArguments(args);
    } catch (InstantiationException e) {
        e.printStackTrace();
        return;
    } catch (IllegalAccessException e) {
        e.printStackTrace();
        return;
    }

    if (addToBackStack) {
        ft.addToBackStack(null);
    }

    // Change to a new fragment
    ft.replace(R.id.container, newFragment, clazz.getName());
    ft.commit();

}
// End of fragments management
//
// ---------------------------------------------------------------------------------------------

}

and when my fragment with the button wants to bring up the list fragment it calls
replaceFragment(ListFragment.class, true, null);

So - to be clear, the ListFragemnt comes up, and all its code fires including recrersating the RecyclerView and repopulating it - I even see all the code in the adapter being called for each item - but the items do not appear in the list
public class ListFragment extends BaseFragment implements ListFragmentMvc.ListViewMvcListener {

private List<MyStuff> stuffList;

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
    stuffList = new ArrayList<>();
    return inflater.inflate(R.layout.list_activity, container, true);
}

@Override
public void onResume() {
    super.onResume();
    recyclerView = mRootView.findViewById(R.id.recycler_view);

    letsGoButton = mRootView.findViewById(R.id.lets_go_button);
    letsGoButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Activity activity = getActivity();
    if (activity != null) {
        getActivity().onBackPressed();
    }

        }
    });

    recyclerView.setItemAnimator(new DefaultItemAnimator());

    DividerItemDecoration itemDecor = new DividerItemDecoration(context, HORIZONTAL);
    recyclerView.addItemDecoration(itemDecor);

    RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(context);
    recyclerView.setLayoutManager(mLayoutManager);

    setData(MyApplication.getAllStuffItems());

}
public void setData(List<MyStuff> stuff) {
    stuffList = stuff;
    mAdapter = new StuffAdapter(stuffList);
    recyclerView.setAdapter(mAdapter);

    mAdapter.notifyDataSetChanged();
}

}

So, anyone have a clue why this doesn't work until I change orientation on re-entering the listFragment?
Thanks

A:

Wow, that was a wild waste of a day.
In the end I had a couple of errors which were pasting over and hiding each other.
The real real reason this wasn't working, I think was because I should have had
return inflater.inflate(R.layout.list_activity, container, false);

instead of 
return inflater.inflate(R.layout.list_activity, container, true);

I lied a little in my code because I wasn't really directly returning the result of inflater.inflate... I was calling it (with the wrong parameter) and then returning null.
I guess that will teach me to be more honest in the posting

