title: Firebase Recycler View Adapter
body: <p>We have a traditional ListView interfaced with a RecyclerView Adapter and a Model class. When we log in to Firebase we navigate to the ListView nothing is loaded in the ListView. We then go back to the login activity and repeat the process
  Then all the data is loaded from a very simple DB child node Table List
  We tired the Firebase RecyclerAdapter with no luck we may have had the wrong UI or version. Our question is why do we need to make two trips to the list view to load the data? We will post the ListView code NO Errors are generated We did try placing the code in an OnStart method no luck with that</p>
  
  <pre><code>        db = FirebaseDatabase.getInstance().getReference();
      dbRef = db.child("Table List");
  
      dbRef.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
  
              for (DataSnapshot child : dataSnapshot.getChildren())
                  listArrayList.add(child.getValue(String.class));
              sz = listArrayList.size();
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  
      sz = listArrayList.size();
  
      if(sz == 0){
          tvNoData.setVisibility(View.VISIBLE);
          tvNoData.setText("No Quiz's Found\n\nClick On Make New Quiz");
  
          mRecyclerView = findViewById(R.id.recycleview);
          mRecyclerView.setHasFixedSize(true);
  
          mLayoutManager = new LinearLayoutManager(this);
          mRecyclerView.setLayoutManager(mLayoutManager);
  
          mAdapter = new TableTrackerAdapter(this,listArrayList);
          mRecyclerView.setAdapter(mAdapter);
      }
  
      if(sz &gt; 0){
          tvNoData.setVisibility(View.INVISIBLE);
  
          mRecyclerView = findViewById(R.id.recycleview);
          mRecyclerView.setHasFixedSize(true);
  
          mLayoutManager = new LinearLayoutManager(this);
          mRecyclerView.setLayoutManager(mLayoutManager);
  
          mAdapter = new TableTrackerAdapter(this,listArrayList);
          mRecyclerView.setAdapter(mAdapter);
  
      }
  </code></pre>