Q:

Firebase Recycler Adapter is not showing my Recyclerview in Fragments

Basically i followed the accepted answer of this with few changes in my Activity and it worked perfect. My problem is that I wrote the exact same codes for my Fragment. when I open my app, it doesn't show anything. Before I changed my code in my fragment from a custom Adapter to the FirebaseRecyclerAdapter, everything worked fine. 
This is my Fragment class
public class HomeFragment extends BaseFragment {

public Button buttonsrch, openFreezer, openRef, openPantry, scrollToFreezer, scrollToRef, scrollToPantry;
public NestedScrollView scrollView;
public RelativeLayout mFreezerLayout,mRefrigeratorLayout, mPantryLayout;
public FloatingActionButton mAddItems;
public DatabaseReference mDatabaseFreezer;
public RecyclerView mFreezerRecyclerView;
public ArrayList<Event> mDataSet;
private FirebaseRecyclerAdapter<Event, ProductHolder> firebaseRecyclerAdapter;

@Override
public int getLayoutResId() {
    return R.layout.fragment_home;
}

@Override
public View inOnCreateView(View root, @Nullable ViewGroup container, Bundle savedInstancesState) {

    View view = mRoot;

    buttonsrch = view.findViewById(R.id.searchButton);
    openPantry = view.findViewById(R.id.ShowMorePantry);
    openRef = view.findViewById(R.id.ShowMoreRefrigerator);
    openFreezer = view.findViewById(R.id.ShowMoreFreezer);
    scrollToFreezer = view.findViewById(R.id.bringToFreezer);
    scrollToPantry = view.findViewById(R.id.bringToPantry);
    scrollToRef = view.findViewById(R.id.bringToRefrigerator);
    scrollView = view.findViewById(R.id.scrollViewHomeFragment);
    mFreezerLayout = view.findViewById(R.id.FreezerLayout);
    mPantryLayout =view.findViewById(R.id.PantryRelativeLayout);
    mRefrigeratorLayout = view.findViewById(R.id.RefrigeratorRelativeLayout);
    mAddItems = view.findViewById(R.id.addItems_Inventory);

    mAddItems.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(getActivity(), AddInventoryActivity.class));
        }
    });

    buttonsrch.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent i = new Intent(getActivity(), Search_Activity.class);
            getActivity().startActivity(i);
        }
    });
    openPantry.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent h = new Intent(getActivity(), PantryActivity.class);
            getActivity().startActivity(h);
        }
    });
    openRef.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent g = new Intent(getActivity(), RefActivity.class);
            getActivity().startActivity(g);
        }
    });
    openFreezer.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent s = new Intent(getActivity(), FreezerActivity.class);
            getActivity().startActivity(s);
        }
    });

    scrollToFreezer.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            FocusToFreezer();
        }
    });
    scrollToRef.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            FocusToRef();
        }
    });
    scrollToPantry.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            FocusToPantry();
        }
    });

    mDataSet = new ArrayList<>();
    mFreezerRecyclerView = view.findViewById(R.id.FreezerRecyclerView);
    mFreezerRecyclerView.setHasFixedSize(true);
    mFreezerRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

    mDatabaseFreezer = FirebaseDatabase.getInstance().getReference().child("FreezerItems");
    Query query = mDatabaseFreezer;

    FirebaseRecyclerOptions<Event> firebaseRecyclerOptions = new FirebaseRecyclerOptions.Builder<Event>()
            .setQuery(query, Event.class).build();

    firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Event, ProductHolder>(firebaseRecyclerOptions) {
        @Override
        protected void onBindViewHolder(ProductHolder holder, int position, Event model) {
            model = mDataSet.get(position);
            holder.mItemName.setText(model.getName());
            holder.mItemDate.setText(model.getDate());
            final Event finalModel = model;
            holder.mDeleteBtn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    mDatabaseFreezer.child(finalModel.get_id()).removeValue();
                }
            });

        }

        @Override
        public ProductHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.recycler_view_row_inventory,parent,false);

            return new ProductHolder(view);
        }
    };

    mDatabaseFreezer.addChildEventListener(new ChildEventListener() {
        @Override
        public void onChildAdded(DataSnapshot dataSnapshot, String s) {

            HashMap<String, String> value = (HashMap<String,String>) dataSnapshot.getValue();
            if (value != null) {
                String name = value.get("Name");
                String date = value.get("Date");
                String key = value.get("Key");
                mDataSet.add(new Event(name,date,null, key));
                Collections.sort(mDataSet, new Comparator<Event>() {
                    @Override
                    public int compare(Event event, Event t1) {
                        if (event.getDate() == null || t1.getDate() == null)
                        return 0;
                        return event.getDate().compareTo(t1.getDate());
                    }
                });
            }
        }

        @Override
        public void onChildChanged(DataSnapshot dataSnapshot, String s) {

        }

        @Override
        public void onChildRemoved(DataSnapshot dataSnapshot) {

        }

        @Override
        public void onChildMoved(DataSnapshot dataSnapshot, String s) {

        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });

    mFreezerRecyclerView.setAdapter(firebaseRecyclerAdapter);

    return root;
}

private class ProductHolder extends RecyclerView.ViewHolder{
    private TextView mItemName, mItemDate;
    private Button mDeleteBtn;

    public ProductHolder(View itemView) {
        super(itemView);
        mItemName = itemView.findViewById(R.id.ItemNameTxtView);
        mItemDate = itemView.findViewById(R.id.BestBeoforeTxtView);
        mDeleteBtn = itemView.findViewById(R.id.deleteItem);
    }
}

@Override
public void onStart() {
    super.onStart();
    firebaseRecyclerAdapter.startListening();
}

@Override
public void onStop() {
    super.onStop();
    if (firebaseRecyclerAdapter != null){
        firebaseRecyclerAdapter.startListening();
    }
}

private void FocusToFreezer(){
    scrollView.post(new Runnable() {
        @Override
        public void run() {
            scrollView.smoothScrollTo(0, mFreezerLayout.getTop());
        }
    });
}

private void FocusToRef(){
    scrollView.post(new Runnable() {
        @Override
        public void run() {
            scrollView.smoothScrollTo(0, mRefrigeratorLayout.getTop());
        }
    });
}

private void FocusToPantry(){
    scrollView.post(new Runnable() {
        @Override
        public void run() {
            scrollView.smoothScrollTo(0, mPantryLayout.getTop());
        }
    });
}

}

The only difference I could find is OnStart() and onStop() in activity are protected while on fragments are public

EDIT I found another page with the same problem and apparently FirebaseRecyclerAdapter doesn't work well with Fragments

A:

I finally found an answer
simply remove  mFreezerRecyclerView.setHasFixedSize(true);

