title: android studio recyclerview firebase not showing data
body: <p>l am try to build Android book store project using Firebase Database and recyclerview to display my data . But the problem is when i run my app i have empty activity without any error . </p>
  
  <p>RecyclerViewActivity java:</p>
  
  <pre><code>package sky.ex.ai.booksstore;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.recyclerview.widget.LinearLayoutManager;
  import androidx.recyclerview.widget.RecyclerView;
  
  import android.os.Bundle;
  import android.util.Log;
  
  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;
  
  import java.util.ArrayList;
  
  public class RecyclerViewActivity extends AppCompatActivity {
  
      RecyclerView rviwe;
      ArrayList&lt;BookDetails&gt; plist;
      ItemAdapter itemAdapter;
      FirebaseDatabase fb;
      DatabaseReference ref;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_recycler_view);
  
          rviwe = findViewById(R.id.recycler_view);
          plist = new ArrayList&lt;BookDetails&gt;();
          fb = FirebaseDatabase.getInstance();
          ref = fb.getReference("Library");
  
          ref.addListenerForSingleValueEvent(new ValueEventListener() {
              @Override
              public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                  for (DataSnapshot ds:dataSnapshot.getChildren()){
  
                      BookDetails p = ds.getValue(BookDetails.class);
                      plist.add(new BookDetails(p.bkname,p.bkAuthor));
  
                      Log.i("THE_CURRENT_USER:::", p.toString());
                  }
              }
  
              @Override
              public void onCancelled(@NonNull DatabaseError databaseError) {
  
              }
  
  
          });
          LinearLayoutManager im = new LinearLayoutManager((this));
          rviwe.setLayoutManager(im);
          itemAdapter = new ItemAdapter(plist);
          rviwe.setAdapter(itemAdapter);
  
      }
  }
  </code></pre>
  
  <p>activity_recycler_view xml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout 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=".RecyclerViewActivity"&gt;
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:id="@+id/recycler_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>Item layout xml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 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"
      android:orientation="horizontal"&gt;
  
      &lt;ImageView
          android:id="@+id/imageView"
          android:layout_width="138dp"
          android:layout_height="59dp"
          android:layout_weight="1"
          app:srcCompat="@drawable/book" /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:orientation="vertical"
          android:paddingLeft="10dp"&gt;
  
          &lt;TextView
              android:id="@+id/book_name_list"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Book name" /&gt;
  
          &lt;TextView
              android:id="@+id/book_author_list"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Book Author" /&gt;
  
          &lt;TextView
              android:id="@+id/book_price_list"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="Book price" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Book Details Class </p>
  
  <pre><code>package sky.ex.ai.booksstore;
  
      public class BookDetails {
  
         String bkAuthor;
         String bkname;
  
          public BookDetails() {
          }
  
         public BookDetails(String bkname, String bkAuthor){
             this.bkAuthor = bkAuthor;
             this.bkname = bkname;
         }
  
          public String getBkAuthor() {
              return bkAuthor;
          }
  
          public void setBkAuthor(String bkAuthor) {
              this.bkAuthor = bkAuthor;
          }
  
          public String getBkname() {
              return bkname;
          }
  
          public void setBkname(String bkname) {
              this.bkname = bkname;
          }
      }
  </code></pre>
  
  <p>Item Adapter java </p>
  
  <pre><code>package sky.ex.ai.booksstore
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageButton;
  import android.widget.TextView;
  
  import androidx.annotation.NonNull;
  import androidx.recyclerview.widget.RecyclerView;
  
  import java.util.ArrayList;
  
  public class ItemAdapter extends RecyclerView.Adapter&lt;ItemAdapter.ViewHolder&gt; {
  
      public ArrayList&lt;BookDetails&gt; itemlist;
  
      public ItemAdapter(ArrayList&lt;BookDetails&gt; itemlist) {
          this.itemlist = itemlist;
      }
  
  
      @Override
      public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int viewType) {
          View view = LayoutInflater
                  .from(viewGroup.getContext()).inflate(R.layout.item_layot,viewGroup, false);
          ViewHolder vh = new ViewHolder(view);
          return vh;
      }
  
      @Override
      public void onBindViewHolder(@NonNull ViewHolder holder, int i) {
          holder.txt_pname.setText("Book Name :" +itemlist.get(i).bkname);
          holder.txt_pid.setText("Book Author :" +itemlist.get(i).bkAuthor);
      }
  
      @Override
      public int getItemCount() {
          if (itemlist==null)
              return 0;
          else  return itemlist.size();
      }
  
      class ViewHolder extends RecyclerView.ViewHolder{
  
          public ImageButton imgb1;
          public TextView txt_pid,txt_pname,txt_pric;
  
  
          public ViewHolder(@NonNull View itemView) {
              super(itemView);
  
              txt_pid = itemView.findViewById(R.id.book_name_list);
              txt_pname = itemView.findViewById(R.id.book_author_list);
          }
      }
  
  
  }
  </code></pre>
  
  <p>Database structure </p>
  
  <p><a href="https://i.stack.imgur.com/n6sf1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n6sf1.png" alt="enter image description here"></a></p>
  
  <p>any idea please ? </p>