I have a collection stored in Firestore, which is called "Score", there I have saved different values (all are int).
What I want is to show the values in another simple activity.
I tried the following code:
public void Resultado(View view) {
noteref.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists()){
String resultado = documentSnapshot.getString("Uid");
resul.setText(resultado);
} else {
Toast.makeText(ResultadoQ1.this, "No hay datos", Toast.LENGTH_SHORT).show();
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
}
});
}
The problem is that when you run the activity, only the "The app has problems" warning comes out.
I would greatly appreciate the help