title: How can I get specific user info from Firebase and display in RecyclerView?
body: <p><strong>Desired Behaviour</strong>: Trying to display a single user info i.e. all the project titles and descriptions &quot;protitle&quot; and &quot;prodesc&quot; data from Firebase after log-in.</p>
  <p>Note: I am pushing username from the login page using intent.putExtra()</p>
  <p>My database snapshot:
  <a href="https://i.stack.imgur.com/QtMzX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QtMzX.png" alt="enter image description here" /></a></p>
  <p><strong>Main Class:</strong></p>
  <pre><code>import android.content.Intent;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.recyclerview.widget.LinearLayoutManager;
  import androidx.recyclerview.widget.RecyclerView;
  
  import com.firebase.ui.database.FirebaseRecyclerAdapter;
  import com.firebase.ui.database.FirebaseRecyclerOptions;
  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 BeginStart extends AppCompatActivity {
  
   FirebaseDatabase rootNode;
      DatabaseReference ref;
     private RecyclerView recyclerView;
      String Receive_username;
  
  
      private FirebaseRecyclerOptions&lt;model&gt; options;
      private FirebaseRecyclerAdapter&lt;model, MyViewHolder&gt; adapter;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.testlayout);
  
   //receive username to connect data
          Intent intent = getIntent();
          Receive_username = intent.getStringExtra(&quot;push_username&quot;);
  
          rootNode = FirebaseDatabase.getInstance();
          ref = rootNode.getReference(&quot;Users&quot;).child(Receive_username);
  
  
  
          recyclerView =findViewById(R.id.testrecycle);
          recyclerView.setHasFixedSize(true);
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
  
    options = new FirebaseRecyclerOptions.Builder&lt;model&gt;().setQuery(ref, model.class).build();
          adapter = new FirebaseRecyclerAdapter&lt;model, MyViewHolder&gt;(options) {
              @Override
              protected void onBindViewHolder(@NonNull final MyViewHolder holder, int position, @NonNull final model model) {
                  //Toast.makeText(getApplicationContext(), &quot;On Bind!&quot;, Toast.LENGTH_SHORT).show();
                  holder.textViewtitle.setText(model.getProtitle());
                  holder.textViewdesc.setText(model.getProdesc());
              }
  
              @NonNull
              @Override
              public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
                 View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.single_view_layout,parent,false);
                  return new MyViewHolder(v);
              }
          };
  
          adapter.startListening();
          recyclerView.setAdapter(adapter);
  
      }
  }
  </code></pre>
  <p><strong>Model Class:</strong></p>
  <pre><code>public class model {
  
      String protitle, prodesc;
  
      public model() {
      }
  
      public model(String protitle, String prodesc) {
          this.protitle = protitle;
          this.prodesc = prodesc;
      }
  
      public String getProtitle() {
          return protitle;
      }
  
      public void setProtitle(String protitle) {
          this.protitle = protitle;
      }
  
      public String getProdesc() {
          return prodesc;
      }
  
      public void setProdesc(String prodesc) {
          this.prodesc = prodesc;
      }
  }
  </code></pre>
  <p><strong>View Handler Class:</strong></p>
  <pre><code>import android.view.View;
  import android.widget.TextView;
  
  import androidx.annotation.NonNull;
  import androidx.recyclerview.widget.RecyclerView;
  
  class MyViewHolder extends RecyclerView.ViewHolder {
  
  TextView textViewtitle, textViewdesc;
  
  
  
  
      public MyViewHolder(@NonNull View itemView) {
          super(itemView);
  
          textViewtitle = itemView.findViewById(R.id.textviewtitle);
          textViewdesc = itemView.findViewById(R.id.textviewdesc);
      }
  }
  </code></pre>
  <p><strong>RecyclerView layout:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot; android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
  
      &lt;androidx.recyclerview.widget.RecyclerView
          android:id=&quot;@+id/testrecycle&quot;
          android:layout_marginRight=&quot;16dp&quot;
          android:layout_marginLeft=&quot;16dp&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          &gt;
  
      &lt;/androidx.recyclerview.widget.RecyclerView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>Single view layout for RecyclerView:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot; android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;wrap_content&quot;&gt;
  
  
  &lt;TextView
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:id=&quot;@+id/textviewtitle&quot;
      android:text=&quot;title&quot;
      android:textSize=&quot;30dp&quot;/&gt;
      &lt;TextView
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:id=&quot;@+id/textviewdesc&quot;
          android:text=&quot;email&quot;
          android:textSize=&quot;30dp&quot;/&gt;
  
  
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>