Here is the updated version of your code with RecyclerView integration:

package com.example.profile;

import androidx.appcompat.app.AppCompatActivity;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

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 Result extends AppCompatActivity {
    DrawerLayout drawerLayout;
    private static final String TAG = “Result”;
    private EditText mNodeNameEditText;
    private DatabaseReference mDatabaseRef;

    private RecyclerView mRecyclerView;
    private RecyclerViewAdapter mAdapter;
    private ArrayList<Item> mData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);

        drawerLayout = findViewById(R.id.drawer_activity);

        mNodeNameEditText = findViewById(R.id.node_name_edit_text);

        // Set up RecyclerView
        mRecyclerView = findViewById(R.id.recycler_view);
        mRecyclerView.setHasFixedSize(true);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

        mData = new ArrayList<>();

        // Set default node of the database
        mDatabaseRef = FirebaseDatabase.getInstance().getReference(“users”);

        mNodeNameEditText.setOnEditorActionListener((textView, i, keyEvent) -> {
            if (i == EditorInfo.IME_ACTION_DONE) {
                String nodeName = mNodeNameEditText.getText().toString().trim();
                if (!nodeName.isEmpty()) {
                    retrieveData(nodeName); // Retrieve data for entered node name
                }
                return true;
            }
            return false;
        });

    }

    private void retrieveData(String nodeName) {
        DatabaseReference myRef = mDatabaseRef.child(nodeName); // Get reference for entered node name

        myRef.addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                for (DataSnapshot childSnapshot : dataSnapshot.getChildren()) {
                    String name = childSnapshot.getKey();
                    String data = childSnapshot.getValue().toString();
                    mData.add(new Item(name, data));
                }
                if (!mData.isEmpty()) {
                    mAdapter = new RecyclerViewAdapter(Result.this, mData);
                    mRecyclerView.setAdapter(mAdapter);
                } else {
                    Toast.makeText(Result.this, “Data not found in the '” + nodeName + “’ node”, Toast.LENGTH_SHORT).show();
                }
            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {
                Log.w(TAG, “Failed to read value.”, databaseError.toException());
            }
        });
    }

    // Add the rest of your Click methods and existing code

}


Also, add a new class called Item for storing data:

public class Item {
    private String mName;
    private String mData;

    public Item(String name, String data) {
        mName = name;
        mData = data;
    }

    public String getName() {
        return mName;
    }

    public String getData() {
        return mData;
    }
}


Replace your activity_result.xml file’s content with the following code to integrate RecyclerView into your layout:

<androidx.constraintlayout.widget.ConstraintLayout
    …>

    <EditText
        android:id=“@+id/node_name_edit_text”
        …/>

    <androidx.recyclerview.widget.RecyclerView
        android:id=“@+id/recycler_view”
        android:layout_width=“match_parent”
        android:layout_height=“0dp”
        app:layout_constraintTop_toBottomOf=“@+id/node_name_edit_text”
        app:layout_constraintBottom_toBottomOf=“parent”/>

    <!-- Add your other layout components such as the DrawerLayout, etc. -->

</androidx.constraintlayout.widget.ConstraintLayout>


Now add a RecyclerViewAdapter class, which extends RecyclerView.Adapter:

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;

public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {

    private Context mContext;
    private ArrayList<Item> mItems;

    public RecyclerViewAdapter(Context context, ArrayList<Item> items) {
        mContext = context;
        mItems = items;
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_data, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
        Item currentItem = mItems.get(position);

        holder.mNameTextView.setText(currentItem.getName());
        holder.mDataTextView.setText(currentItem.getData());
    }

    @Override
    public int getItemCount() {
        return mItems.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        public TextView mNameTextView;
        public TextView mDataTextView;

        public ViewHolder(@NonNull View itemView) {
            super(itemView);

            mNameTextView = itemView.findViewById(R.id.name_text_view);
            mDataTextView = itemView.findViewById(R.id.data_text_view);
        }
    }
}


Finally, add a new xml layout file called item_data.xml to show data in each RecyclerView item:

<androidx.constraintlayout.widget.ConstraintLayout
    … >

    <TextView
        android:id=“@+id/name_text_view”
        android:layout_width=“wrap_content”
        android:layout_height=“wrap_content”
        … />

    <TextView
        android:id=“@+id/data_text_view”
        android:layout_width=“0dp”
        android:layout_height=“wrap_content”
        app:layout_constraintEnd_toEndOf=“parent”
        app:layout_constraintStart_toEndOf=“@+id/name_text_view”
        … />
    
</androidx.constraintlayout.widget.ConstraintLayout>