title: Why my recyclerview not showing up when launch the app at the beginning?
body: <p>I did project on cinemas app. I want to list up the cinema that available from my cloud firestore, but somehow the application i created did not show my cinema. Sometimes it show up but when I got to second activity and come back to the main activity, the recycler view is empty. I think my onStart and onStop is correct. I did check on my LocationAdapter.java, Location.java,cinemalist.xml, and activity_home.xml. Everything seems fine but when i try to launch my app the only the button show up. Anyone can help me?
  This is my activity_home.xml and below it is the result when i run my app.</p>
  
  <p><a href="https://i.stack.imgur.com/QurtC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QurtC.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/TBJMO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TBJMO.png" alt="enter image description here"></a></p>
  
  <p>My HomeActivity.java</p>
  
  <pre><code>public class HomeActivity extends AppCompatActivity {
      RecyclerView recyclerView;
      private FirebaseFirestore db = FirebaseFirestore.getInstance();
      private CollectionReference movieRef = db.collection("cinemasLocation");
      RecyclerView.LayoutManager layoutManager;
      private FirestoreRecyclerAdapter&lt;Location, LocationViewHolder&gt; adapter;
      FirebaseAuth firebaseAuth;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_home);
  
          Button buttonPI = (Button)findViewById(R.id.bPI);
          Button buttonMA = (Button)findViewById(R.id.bMovie);
          Toolbar toolbar = (Toolbar)findViewById(R.id.TB);
          setSupportActionBar(toolbar);
  
  
          buttonPI.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent (HomeActivity.this,AccountInformation.class);
                  startActivity(intent);
              }
          });
  
          buttonMA.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(HomeActivity.this,MovieActivity.class);
                  startActivity(intent);
              }
          });
  
          Query query = movieRef.orderBy("title",Query.Direction.ASCENDING);
          FirestoreRecyclerOptions&lt;Location&gt; options = new FirestoreRecyclerOptions.Builder&lt;Location&gt;()
                  .setQuery(query,Location.class)
                  .build();
  
          recyclerView = findViewById(R.id.rvCinema);
          recyclerView.setHasFixedSize(true);
          layoutManager = new LinearLayoutManager(this);
          recyclerView.setLayoutManager(layoutManager);
          adapter = new FirestoreRecyclerAdapter&lt;Location, LocationViewHolder&gt;(options) {
              @Override
              protected void onBindViewHolder(@NonNull LocationViewHolder holder, int position, @NonNull Location model) {
                  holder.setData(model.address,model.image,model.located,model.phone,model.title);
              }
  
              @NonNull
              @Override
              public LocationViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
                  View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.cinemalist,parent,false);
                  return new LocationViewHolder(view);
              }
          };
          recyclerView.setAdapter(adapter);
      }
      private class LocationViewHolder extends RecyclerView.ViewHolder{
          private View view;
          LocationViewHolder(View itemView){
              super(itemView);
              view = itemView;
          }
  
          void setData(String address, String image, String located, String phone, String title){
              TextView tvTitleLocation;
              TextView tvLocation;
              TextView tvPhone;
              ImageView moviePicture;
              tvTitleLocation = itemView.findViewById(R.id.tvTitleLocation);
              tvLocation = itemView.findViewById(R.id.tvAddress);
              tvPhone = itemView.findViewById(R.id.tvContact);
              moviePicture = itemView.findViewById(R.id.ivLocation);
              // Set data to views
              tvTitleLocation.setText(title);
              tvLocation.setText(located);
              tvPhone.setText(phone);
              Picasso.get().load(image).into(moviePicture);
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.main,menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()){
              case R.id.logOut:
                  FirebaseAuth.getInstance().signOut();
                  Intent intToMain = new Intent ( HomeActivity.this,MainActivity.class);
                  startActivity(intToMain);
                  finish();
                  return true;
              case android.R.id.home:
                  onBackPressed();
                  return true;
              default:
                  onResume();
                  return super.onOptionsItemSelected(item);
          }
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          adapter.startListening();
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          if (adapter != null) {
              adapter.stopListening();
          }
      }
  
  }
  
  </code></pre>
  
  <p>activtiy_home.xml</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=".HomeActivity"&gt;
  
      &lt;androidx.appcompat.widget.Toolbar
          android:id="@+id/TB"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="@color/colorPrimary"
          android:elevation="4dp"
          android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
          app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_below="@id/TB"
          android:orientation="vertical"&gt;
  
          &lt;androidx.recyclerview.widget.RecyclerView
              android:id="@+id/rvCinema"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:padding="50dp" /&gt;
  
          &lt;Button
              android:id="@+id/bPI"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:text="Personal Information" /&gt;
  
          &lt;Space
              android:layout_width="match_parent"
              android:layout_height="50dp" /&gt;
  
          &lt;Button
              android:id="@+id/bMovie"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:text="Movie Available" /&gt;
  
      &lt;/LinearLayout&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>movielist.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:cardBackgroundColor="#fff"
      app:cardCornerRadius="3dp"
      app:cardElevation="3dp"
      app:cardUseCompatPadding="true"
      app:contentPadding="5dp"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:padding="10dp"&gt;
  
          &lt;TextView
              android:id="@+id/tvTitle"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Title"
              android:textColor="#000"
              android:textSize="22sp"
              android:textStyle="bold" /&gt;
  
          &lt;ImageView
              android:id="@+id/ivMovie"
              android:layout_width="match_parent"
              android:layout_height="200dp"
              android:adjustViewBounds="true"
              android:background="@drawable/loading"
              android:scaleType="centerCrop"&gt;&lt;/ImageView&gt;
  
          &lt;TextView
              android:id="@+id/tvReleaseDate"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="ReleaseDate"
              android:textSize="20sp" /&gt;
  
          &lt;TextView
              android:id="@+id/tvDescription"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Description" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/androidx.cardview.widget.CardView&gt;
  </code></pre>
  
  <p>This is my database
  <a href="https://i.stack.imgur.com/dytu6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dytu6.png" alt="enter image description here"></a></p>
  
  <p><strong>Edited: I remove my LocationAdapter.java and put use FirestoreRecyclerAdapter annonymous implementation inside your HomeActivity</strong></p>