How To Show Firebase Data In TextViews Using UserInformation Class

I am having trouble showing the correct user information from my realtime database to the specific textviews. At the moment, none of them are showing

This application includes android studio and extracting user information based on email and userId.

My database structure is pretty simple as it looks like this: enter image description here

My UserInformation class is types as such:

public class UserInformation {

private String name;
private String email;
private String campus;
private String twop_num;
private Timestamp expiration_date;
private Double meals;
private Double pfunds;

public UserInformation(){


public String getName() {
    return name;

public void setName(String name) { = name;

public String getEmail() {
    return email;

public void setEmail(String email) { = email;

public String getCampus() {
    return campus;

public void setCampus(String campus) {
    this.campus = campus;

public String getTwop_num() {
    return twop_num;

public void setTwop_num(String twop_num) {
    this.twop_num = twop_num;

public Timestamp getExpiration_date() {
    return expiration_date;

public void setExpiration_date(Timestamp expiration_date) {
    this.expiration_date = expiration_date;

public Double getMeals() {
    return meals;

public void setMeals(Double meals) {
    this.meals = meals;

public Double getpfunds() {
    return pfunds;

public void setpfunds(Double punds) {
    this.pfunds = punds;

And I believe the problem is with pulling the data from the database of the 'append" method I am using when trying to show the information in the TextView. The code is:

    private TextView Email;
private TextView TwoPNum;
private TextView Meal;
private TextView PantherFunds;
private TextView Expiration;
private TextView Campus;
private Button logout;


 Email = (TextView) findViewById(;
 TwoPNum = (TextView) findViewById(;
 Meal = (TextView) findViewById(;
 PantherFunds = (TextView) findViewById(;
 Expiration = (TextView) findViewById(;
 Campus = (TextView) findViewById(;


  private void showData(DataSnapshot dataSnapshot) {
    for (DataSnapshot ds : dataSnapshot.getChildren()) {
        UserInformation uInfo = new UserInformation();
        uInfo.setName(ds.child(userID).getValue(UserInformation.class).getName()); //set the name
        uInfo.setEmail(ds.child(userID).getValue(UserInformation.class).getEmail()); //set the email
        uInfo.setCampus(ds.child(userID).getValue(UserInformation.class).getCampus()); //set the phone_num
        uInfo.setExpiration_date(ds.child(userID).getValue(UserInformation.class).getExpiration_date());// set expiration date
        uInfo.setpfunds(ds.child(userID).getValue(UserInformation.class).getpfunds()); // get pantherfunds
        uInfo.setMeals(ds.child(userID).getValue(UserInformation.class).getMeals()); // get Meals
        uInfo.setTwop_num(ds.child(userID).getValue(UserInformation.class).getTwop_num()); // get Meals

        //display all the information
        Log.d(TAG, "showData: name: " + uInfo.getName());
        Log.d(TAG, "showData: email: " + uInfo.getEmail());
        Log.d(TAG, "showData: campus : " + uInfo.getCampus());
        Log.d(TAG, "showData: expiration_date: " + uInfo.getExpiration_date());
        Log.d(TAG, "showData: pfunds: " + uInfo.getpfunds());
        Log.d(TAG, "showData: : meals" + uInfo.getMeals());
        Log.d(TAG, "showData: twop_num: " + uInfo.getTwop_num());

        // Show Data in TextViews



It seems you are using firestore and not realtime database, to retrieve data of the collection in firestore try the following:

    .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
        public void onComplete(@NonNull Task<QuerySnapshot> task) {
            if (task.isSuccessful()) {
                for (QueryDocumentSnapshot document : task.getResult()) {
                    Log.d(TAG, document.getId() + " => " + document.getData());
            } else {
                Log.d(TAG, "Error getting documents: ", task.getException());

Check the docs for more info: