title: I am having adapter problem. Can anyone know the solution
body: <p>Can anybody help me to sort out this problem? I looked similar question posted by other learner, still I am not able to solve my problem. When the app runs, the activity displays only white screen. </p>
  
  <p>My catlog shows below error:
  E/RecyclerView: No adapter attached; skipping layout.  </p>
  
  <p>Here is my code:</p>
  
  <p>Order Status Activity:</p>
  
  <pre><code>package com.example.android_foodbot;
  
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.widget.RecyclerView;
  import android.view.View;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.example.android_foodbot.AccountActivity.User;
  import com.example.android_foodbot.Model.Request;
  import com.example.android_foodbot.ViewHolder.OrderViewHolder;
  import com.firebase.ui.database.FirebaseRecyclerAdapter;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.database.DataSnapshot;
  import com.google.firebase.database.DatabaseError;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.google.firebase.database.ValueEventListener;
  
  public class OrderStatusActivity extends AppCompatActivity {
  
      public RecyclerView recyclerView;
      public RecyclerView.LayoutManager layoutManager;
  
      FirebaseRecyclerAdapter&lt;Request, OrderViewHolder&gt; adapter;
  
      FirebaseDatabase database;
      DatabaseReference requests;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_order_status);
      enter code here
  
          //Firebase
          database = FirebaseDatabase.getInstance();
          requests = database.getReference("Requests");
  
          recyclerView = (RecyclerView)findViewById(R.id.listOrders);
          recyclerView.setHasFixedSize(true);
          layoutManager = new LinearLayoutManager(this);
          recyclerView.setLayoutManager(layoutManager);
  
  
  
          //Getting current user details
          String uid;
          FirebaseAuth auth;
          auth = FirebaseAuth.getInstance();
          uid = auth.getCurrentUser().getUid();
  
          FirebaseDatabase.getInstance().getReference().child("Users").child(uid).addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                  User user = dataSnapshot.getValue(User.class);
  //                if (user==null){
  //                    Toast.makeText(OrderStatusActivity.this, "NUll user", Toast.LENGTH_SHORT).show();
  //                }
  //                else{
  //                    Toast.makeText(OrderStatusActivity.this, "user is "+user.getPhone(), Toast.LENGTH_SHORT).show();
  //                }
  
                  loadOrders(user.getPhone());
  
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
                  throw databaseError.toException();
  
              }
          });
  
  
  
      }
  
  
      private void loadOrders(String phone){
  //        Toast.makeText(this, "phone is "+phone, Toast.LENGTH_SHORT).show();
          adapter = new FirebaseRecyclerAdapter&lt;Request, OrderViewHolder&gt;(
                  Request.class,
                  R.layout.order_layout,
                  OrderViewHolder.class,
                  requests.orderByChild("phone").equalTo(phone)) {
              @Override
              protected void populateViewHolder(OrderViewHolder viewHolder, Request model, int position) {
                  viewHolder.txtOrderId.setText(adapter.getRef(position).getKey());
                  viewHolder.txtOrderStatus.setText(convertCodeToStatus(model.getStatus()));
                  viewHolder.txtOrderPhone.setText(model.getPhone());
  
  
  
              }
          };
          recyclerView.setAdapter(adapter);
  
  
      }
  
  
      private String convertCodeToStatus(String status){
          switch (status) {
              case "0":
                  return "Placed";
              case "1":
                  return "Processing";
              default:
                  return "Served";
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>Order View Holder:</p>
  
  <pre><code>package com.example.android_foodbot.ViewHolder;
  
  import android.support.annotation.NonNull;
  import android.support.v7.widget.RecyclerView;
  import android.view.View;
  import android.widget.TextView;
  
  import com.example.android_foodbot.Interface.ItemClickListener;
  import com.example.android_foodbot.R;
  
  public class OrderViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
      public TextView txtOrderId, txtOrderStatus, txtOrderPhone;
  
      private ItemClickListener itemClickListener;
  
      public OrderViewHolder(@NonNull View itemView) {
          super(itemView);
  
          txtOrderId = (TextView)itemView.findViewById(R.id.order_id);
          txtOrderStatus = (TextView)itemView.findViewById(R.id.order_status);
          txtOrderPhone = (TextView)itemView.findViewById(R.id.order_phone);
  
          itemView.setOnClickListener(this);
  
      }
  
      public void setItemClickListener(ItemClickListener itemClickListener) {
          this.itemClickListener = itemClickListener;
      }
  
      @Override
      public void onClick(View v) {
          itemClickListener.onClick(v, getAdapterPosition(), false);
  
      }
  }
  </code></pre>
  
  <p>Order Activity:</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=".OrderStatusActivity"&gt;
  
      &lt;android.support.v7.widget.RecyclerView
          android:id="@+id/listOrders"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layoutManager="android.support.v7.widget.LinearLayoutManager"
  
          &gt;
  
  
      &lt;/android.support.v7.widget.RecyclerView&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>When I checked my adapter then I found that getItemCount() method is returning 0 value. Can anyone know how to solve this??</p>
  
  <pre><code>private void loadOrders(String phone){
  
      adapter = new FirebaseRecyclerAdapter&lt;Request, OrderViewHolder&gt;(
              Request.class,
              R.layout.order_layout,
              OrderViewHolder.class,
              requests.orderByChild("phone").equalTo(phone)) {
          @Override
          protected void populateViewHolder(OrderViewHolder viewHolder, Request model, int position) {
              viewHolder.txtOrderId.setText(adapter.getRef(position).getKey());
              viewHolder.txtOrderStatus.setText(convertCodeToStatus(model.getStatus()));
              viewHolder.txtOrderPhone.setText(model.getPhone()); //                Toast.makeText(OrderStatusActivity.this, "Show", Toast.LENGTH_SHORT).show();
  
  
  
  
          }
  
  
      };
  
      recyclerView.setAdapter(adapter);
  
  
      if (recyclerView != null){
          recyclerView.setHasFixedSize(true);
          Toast.makeText(this, "Recycler View is not null ", Toast.LENGTH_SHORT).show();
  
      }
      if (recyclerView == null){ //            Log.v("TAG", "RECYCLERVIEW NULL");
          Toast.makeText(this, "RECYCLERVIEW NULL", Toast.LENGTH_SHORT).show();
  
      } else if (layoutManager == null){ //            Log.v("TAG", "LAYOUTMANAGER NULL");
          Toast.makeText(this, "LAYOUTMANAGER NULL", Toast.LENGTH_SHORT).show();
  
      } else if (adapter == null) { //            Log.v("TAG", "mFIREADAPTER NULL");
          Toast.makeText(this, "mFIREADAPTER NULL", Toast.LENGTH_SHORT).show();
  
      }else if (adapter != null) { //            Log.v("TAG", "mFIREADAPTER NULL");
          Toast.makeText(this, "FIREADAPTER IS NOT NULL" +adapter.getItemCount(), Toast.LENGTH_SHORT).show();
  
      }
  
  
  }
  </code></pre>