title: RecyclerView.Adapter does not reach onCreateViewHolder when using ViewModelProviders?
body: <p>My recyclerview is not reaching onCreateViewHolder or getItemCount. I have checked and am sure that my item count isn't 0, I have added breakpoints in the adapter but except the constructor no other method is being called.</p>
  <p>Questions I have looked at:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/27809524/recyclerview-not-call-oncreateviewholder">Recyclerview not call onCreateViewHolder</a></li>
  <li><a href="https://stackoverflow.com/questions/37674692/what-is-lifecycle-for-recyclerview-**adapter">What is lifecycle for RecyclerView adapter?</a></li>
  </ul>
  <p><strong>RecyclerView.Adapter:</strong></p>
  <pre><code>// I have added only the required methods.
  public class JournalAdapter extends RecyclerView.Adapter&lt;JournalAdapter.ViewHolder&gt; {
     public JournalAdapter(Context context, List&lt;Map&lt;String, Object&gt;&gt; diaryListMaps) {
          this.mInflater = LayoutInflater.from(context);
          this.diaryListMaps = diaryListMaps;
          Log.d(TAG, &quot;Adapter Size: &quot; + diaryListMaps.size());
          Log.d(TAG, String.valueOf(diaryListMaps));
      }
      @NonNull
      @Override
      public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
          View view = mInflater.inflate(R.layout.jourrnal_card, parent, false);
          JournalAdapter.ViewHolder viewHolder = new JournalAdapter.ViewHolder(view);
          Log.d(TAG, &quot;onCreateViewHolder&quot;);
          return viewHolder;
      }
      @Override
      public int getItemCount() {
          if (diaryListMaps.size() == 0) {
              Log.d(TAG, &quot;getItem: &quot; + 1);
              return 1;
          }
          else {
              Log.d(TAG, &quot;getItem: &quot; + 10);
              return diaryListMaps.size();
          }
      }
  }
  </code></pre>
  <p><strong>Fragment:</strong></p>
  <pre><code>        mViewModel = ViewModelProviders.of(this).get(DiaryDashboardViewModel.class);
  
          mViewModel.getJournals().observe(getViewLifecycleOwner(), journalList -&gt; {
              Log.d(TAG, String.valueOf(journalList));
              diaryListMaps.addAll(journalList);
              journalAdapter = new JournalAdapter(getContext(), diaryListMaps);
          });
  
          LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
          layoutManager.setOrientation(RecyclerView.VERTICAL);
  
          journalRecycler.setHasFixedSize(true);
          journalRecycler.setLayoutManager(layoutManager);
          journalRecycler.setAdapter(journalAdapter);
  </code></pre>
  <p><strong>getJournals</strong></p>
  <pre><code>public MutableLiveData&lt;List&lt;Map&lt;String, Object&gt;&gt;&gt; getJournals() {
          Log.d(TAG, &quot;getJournal&quot;);
          dailyWeekColRef
                  .get()
                  .addOnCompleteListener(task -&gt; {
                      if (task.isSuccessful()) {
                          List&lt;Map&lt;String, Object&gt;&gt; dummyList = new ArrayList&lt;&gt;();
                          for (QueryDocumentSnapshot documentSnapshot: Objects.requireNonNull(task.getResult())) {
                              Map&lt;String, Object&gt; dummyMap = documentSnapshot.getData();
                              Log.d(TAG, &quot;Retrived data &quot; + dummyMap);
                              dummyList.add(dummyMap);
                          }
                          journal.postValue(dummyList);
                      }
                      else {
                          Log.d(TAG, &quot;task unsuccessful &quot; + task);
                      }
                  });
          return journal;
      }
  </code></pre>