TLDR: I have been trying to retrieve user information from the Firebase Realtime Database, but the `dataSnapshot` within the addChildEventListener or addValueEventListener seems to always return null. I followed the API exactly to no avail. Please send help!!

My Profile Activity:

```
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.google.firebase.auth.FirebaseAuth;

import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.ChildEventListener;
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.Query;
import com.google.firebase.database.ValueEventListener;

public class ProfileActivity extends AppCompatActivity {
    private static final String tag = "ProfileActivity";
    private static final int PROFILE_ACTIVITY = 1;

    //firebase elements
    private FirebaseAuth mAuth;
    private FirebaseDatabase mDatabase;
    private DatabaseReference mReference;
    private FirebaseUser currentUser;

    //view elements
    private Button logoutBtn;
    private TextView walletBalance, tasksTaken, tasksPosted, userName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile);

        mAuth = FirebaseAuth.getInstance();
        mDatabase = FirebaseDatabase.getInstance();
        currentUser = mAuth.getCurrentUser();
        mReference = mDatabase.getReference(mAuth.getUid());
        Query query = mReference;

        query.addChildEventListener(new ChildEventListener() {
            @Override
            public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
                Log.d(tag, dataSnapshot.getValue().toString());
                if(dataSnapshot.getValue() != null)
                {
                    Log.d(tag, "not null");
                    User newUser = dataSnapshot.getValue(User.class);
                    Log.d(tag, newUser.getName());
                    Log.d(tag, Integer.toString(newUser.getWalletBalance()));
                    Log.d(tag, Integer.toString(newUser.getTasksTaken()));
                    Log.d(tag, Integer.toString(newUser.getTasksPosted()));

                    userName.setText(newUser.getName());
                    walletBalance.setText(newUser.getWalletBalance());
                    tasksTaken.setText(newUser.getTasksTaken());
                    tasksPosted.setText(newUser.getTasksPosted());
                }
            }

            @Override
            public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {

            }

            @Override
            public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {

            }

            @Override
            public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {

            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {

            }
        });

    private void setViewElements() {
        logoutBtn = findViewById(R.id.btn_logout);
        walletBalance = findViewById(R.id.tv_walletBalance);
        tasksTaken = findViewById(R.id.tv_taskSAmount);
        tasksPosted = findViewById(R.id.tv_taskPAmount);
        userName = findViewById(R.id.tv_userName);
    }

    private void goToLoginActivity() {
        startActivity(new Intent(getApplicationContext(), LoginActivity.class));
        finish();
    }

```

My User Object:

```
public class User {
    //user information
    String name, email, password;
    int walletBalance, tasksTaken, tasksPosted;

    //constructor
    public User(String name, String email, String password, int walletBalance, int tasksTaken, int tasksPosted) {
        this.name = name;
        this.email = email;
        this.password = password;
        this.walletBalance = walletBalance;
        this.tasksTaken = tasksTaken;
        this.tasksPosted = tasksPosted;
    }

    //empty constructor
    public User() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getWalletBalance() {
        return walletBalance;
    }

    public void setWalletBalance(int walletBalance) {
        this.walletBalance = walletBalance;
    }

    public int getTasksTaken() {
        return tasksTaken;
    }

    public void setTasksTaken(int tasksTaken) {
        this.tasksTaken = tasksTaken;
    }

    public int getTasksPosted() {
        return tasksPosted;
    }

    public void setTasksPosted(int tasksPosted) {
        this.tasksPosted = tasksPosted;
    }
}

```

My Firebase Database:

[![enter image description here](https://i.stack.imgur.com/y18ke.png)](https://i.stack.imgur.com/y18ke.png)

Any help is very very appreciated!!