title: Firestore data not showing in recycler view
body: <p>I am trying to add data in my recycler view from firestore.
  I have documents with name (Level+&quot;levelNo.&quot;)
  But nothing is showing on my activity
  Here is the code:</p>
  <p>MAIN LEVEL ACTIVITY:</p>
  <pre><code>public class LevelActivity extends AppCompatActivity {
      // Recycler View object
      RecyclerView recyclerView;
  
      // Array list for recycler view data source
      public static List&lt;String&gt; levelList = new ArrayList&lt;&gt;();
  
      // Layout Manager
      RecyclerView.LayoutManager RecyclerViewLayoutManager;
  
      // adapter class object
      LevelAdapter adapter;
  
      // Linear Layout Manager
      LinearLayoutManager HorizontalLayout;
  
      FirebaseFirestore firebaseFirestore;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_level);
  
          // initialisation with id's
          recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
          RecyclerViewLayoutManager = new LinearLayoutManager(getApplicationContext());
  
          // Set LayoutManager on Recycler View
          recyclerView.setLayoutManager(RecyclerViewLayoutManager);
  
          firebaseFirestore = FirebaseFirestore.getInstance();
  
          loadLevel();
          // calling constructor of adapter
          // with source list as a parameter
          adapter = new LevelAdapter(levelList);
  
          // Set Horizontal Layout Manager
          // for Recycler view
          HorizontalLayout = new LinearLayoutManager(LevelActivity.this, LinearLayoutManager.HORIZONTAL, false);
          recyclerView.setLayoutManager(HorizontalLayout);
  
          // Set adapter on recycler view
          recyclerView.setAdapter(adapter);
      }
  
      private void loadLevel(){
          levelList.clear();
  
          firebaseFirestore.collection(&quot;QUIZ LEVELS&quot;)
                  .document(&quot;TOTAL_LEVELS&quot;).get()
                  .addOnCompleteListener(task -&gt; {
                      if (task.isSuccessful()) {
                          DocumentSnapshot doc = task.getResult();
                          if (doc.exists()) {
                              long levelCount = (long) doc.get(&quot;count&quot;);
  
                              for (int i = 1; i &lt;= levelCount; i++) {
                                  String levelName = doc.getString(&quot;LEVEL&quot; + i);
                                  levelList.add(levelName);
                              }
  
                          }else{
                              Toast.makeText(LevelActivity.this, &quot;no level&quot;, Toast.LENGTH_SHORT).show();
                          }
  
                      }else{
  
                          Toast.makeText(LevelActivity.this, task.getException().getMessage(), Toast.LENGTH_SHORT).show();
                      }
                  });
      }
  
  }
  </code></pre>
  <p>LEVEL ADAPTER:</p>
  <pre><code>public class LevelAdapter extends RecyclerView.Adapter&lt;LevelAdapter.MyView&gt; {
  
      // List with String type
      private final List&lt;String&gt; levelList;
  
      // View Holder class which
      // extends RecyclerView.ViewHolder
      public class MyView extends RecyclerView.ViewHolder {
          // Text View
          TextView textView;
  
          // parameterised constructor for View Holder class
          // which takes the view as a parameter
          public MyView(View view) {
              super(view);
              // initialise TextView with id
              textView = (TextView) view.findViewById(R.id.textview);
          }
      }
  
      // Constructor for adapter class
      // which takes a list of String type
      public LevelAdapter(List&lt;String&gt; horizontalList) {
          this.levelList = horizontalList;
      }
  
      // Override onCreateViewHolder which deals
      // with the inflation of the card layout
      // as an item for the RecyclerView.
      @Override
      public MyView onCreateViewHolder(ViewGroup parent, int viewType) {
          // Inflate item.xml using LayoutInflator
          View itemView
                  = LayoutInflater
                  .from(parent.getContext())
                  .inflate(R.layout.recycler_view_item,
                          parent, false);
  
          // return itemView
          return new MyView(itemView);
      }
  
      // Override onBindViewHolder which deals
      // with the setting of different data
      // and methods related to clicks on
      // particular items of the RecyclerView.
      @Override
      public void onBindViewHolder(final MyView holder, final int position) {
          // Set the text of each item of
          // Recycler view with the list items
          holder.textView.setText(levelList.get(position));
      }
  
      // Override getItemCount which Returns
      // the length of the RecyclerView.
      @Override
      public int getItemCount() {
          return levelList.size();
      }
  }
  </code></pre>