The get() method is undefined for the Databasereference type

Asked

Viewed 5 times

0

I’m trying to get user score from the site: /users/uid/points and set it in a textview.

fb.child("usuarios").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).child("pontos").get().addOnCompleteListener(new OnCompleteListener<DataSnapshot>() {
    @Override
    public void onComplete(@NonNull Task<DataSnapshot> task) {
        if (!task.isSuccessful()) {
            Log.e("firebase", "Error getting data", task.getException());
        }
        else {
textview3.setText(String.valueOf(task.getResult().getValue()));
        }
    }
});

But I get the following mistake:

The method get() is Undefined for the type Databasereference.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.