
I need to get data from Firestore Firebase, I need to get the value of field "Company" from "employer" collection -> "TH17..." document. I try some things but it didnt work.
How I can do this?
I try this:
docref = db.collection("employer").document("TH17...");
docref.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.isSuccessful()) {
DocumentSnapshot document = task.getResult();
if (document.exists()) {
String p= document.getData().toString();
Log.d("TAG", "DocumentSnapshot data: " + document.getData());
}
}
}
});