title: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setHasFixedSize(boolean)' on a null object reference
body: <p>so basically when I run my app, the app does not give me any errors however, when I tried open a page called 'Find Food Donations' in my app, it gave me this error code in the log:</p>
  
  <pre><code>'Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setHasFixedSize(boolean)' on a null object reference' and also said that its Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.setHasFixedSize(boolean)' on a null object reference: 
  </code></pre>
  
  <p>at com.example.myddproject.FindFoodDonations.onCreate(FindFoodDonations.java:66). </p>
  
  <p>Below is the code for the app where the error is occurring in the Java File (the line is bolded)</p>
  
  <pre><code>public class FindFoodDonations extends AppCompatActivity{
      private DatabaseReference ProductsRef;
      private RecyclerView recyclerView;
      RecyclerView.LayoutManager layoutManager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_find_food_donations);
  
          ProductsRef = FirebaseDatabase.getInstance().getReference().child("Products");
  
          BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_organization_navigation);
          bottomNavigationView.setSelectedItemId(R.id.nav_find_donations);
          bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
              @Override
              public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                  switch (item.getItemId()) {
                      case R.id.nav_find_donations:
                          return true;
                      case R.id.nav_organization_home:
                          startActivity(new Intent(getApplicationContext()
                                  , HomeOrganization.class));
                          overridePendingTransition(0, 0);
                          return true;
                      case R.id.nav_organization_logout:
                          FirebaseAuth.getInstance().signOut();
                          Intent intosignup = new Intent(FindFoodDonations.this, MainActivity.class);
                          startActivity(intosignup);
                          return true;
                  }
                  return false;
              }
          });
          recyclerView = findViewById(R.id.recycler_menu);
          **recyclerView.setHasFixedSize(true);**
          layoutManager = new LinearLayoutManager(this);
          recyclerView.setLayoutManager(layoutManager);
  
      }
  
      @Override
      protected void onStart() {
          super.onStart();
  
          FirebaseRecyclerOptions&lt;Product&gt; options =
                  new FirebaseRecyclerOptions.Builder&lt;Product&gt;()
                          .setQuery(ProductsRef, Product.class)
                          .build();
  
  
          FirebaseRecyclerAdapter&lt;Product, ProductViewHolder&gt; adapter =
                  new FirebaseRecyclerAdapter&lt;Product, ProductViewHolder&gt;(options) {
                      @Override
                      protected void onBindViewHolder(@NonNull ProductViewHolder productViewHolder, int i, @NonNull Product product) {
                          productViewHolder.txtProductName.setText(product.getPname());
                          productViewHolder.txtProductPrice.setText("Quantity = " + product.getQuantity() + " KG's");
                          Picasso.get().load(product.getImage()).into(productViewHolder.imageView);
                      }
  
                      @NonNull
                      @Override
                      public ProductViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
                          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.product_items_layout, parent, false);
                          ProductViewHolder holder = new ProductViewHolder(view);
                          return holder;
                      }
                  };
          recyclerView.setAdapter(adapter);
          adapter.startListening();
      }
  }
  </code></pre>
  
  <p>The code for the XML File for the page above is:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".FindFoodDonations"&gt;
      &lt;com.google.android.material.bottomnavigation.BottomNavigationView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/bottom_organization_navigation"
          app:itemBackground="@color/design_default_color_on_primary"
          app:itemTextColor="@drawable/selector"
          app:itemIconTint="@drawable/selector"
          app:menu="@menu/organizationbottom_navigation"
          android:layout_alignParentBottom="true"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>And a page that is linked (I dont know if its neccesary, but I'll just put it here)</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      tools:context=".HomeActivity"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/recycler_menu"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:scrollbars="vertical"
          &gt;
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I have not encountered such a error before so I don't know what to do. </p>